Skip to content

Commit

Permalink
more single node bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavis95 committed Mar 23, 2022
1 parent 58eee77 commit 6f7ea1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ public List<ZuliaIndex.IndexSettings> getIndexes() throws Exception {

@Override
public ZuliaIndex.IndexSettings getIndex(String indexName) throws Exception {
return getIndexSettings(new File(baseDir + File.separator + indexName + INDEX_EXTENSION));
File indexSettingsFile = new File(baseDir + File.separator + indexName + INDEX_EXTENSION);
if (indexSettingsFile.exists()) {
return getIndexSettings(indexSettingsFile);
}
else {
return null;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.zulia.server.config.IndexService;
import io.zulia.server.config.ServerIndexConfig;
import io.zulia.server.config.ZuliaConfig;
import io.zulia.server.exceptions.IndexDoesNotExistException;
import io.zulia.server.exceptions.ShardDoesNotExistException;
import io.zulia.server.field.FieldTypeUtil;
import io.zulia.server.filestorage.DocumentStorage;
Expand Down Expand Up @@ -816,6 +817,10 @@ public double getShardTolerance() {
public void reloadIndexSettings() throws Exception {

IndexSettings indexSettings = indexService.getIndex(indexName);
if (indexSettings == null) {
throw new IndexDoesNotExistException(indexName);
}

indexConfig.configure(indexSettings);
configureFacets();
zuliaPerFieldAnalyzer.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ private void loadIndex(String indexName) throws Exception {

IndexSettings indexSettings = indexService.getIndex(indexName);

if (indexSettings == null) {
throw new IndexDoesNotExistException(indexName);
}

loadIndex(indexSettings);
}

Expand Down

0 comments on commit 6f7ea1c

Please sign in to comment.