Skip to content

Commit

Permalink
Fix terms aggregations on indexers (#1178)
Browse files Browse the repository at this point in the history
* Fix terms aggregation bug on indexer nodes

* Formatting
  • Loading branch information
kyle-sammons authored Dec 13, 2024
1 parent c8e587f commit e64b486
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.apache.lucene.search.SortField;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.MMapDirectory;
import org.opensearch.common.lucene.index.OpenSearchDirectoryReader;
import org.opensearch.core.index.shard.ShardId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -142,7 +144,11 @@ public LuceneIndexStoreImpl(
RedactionFilterDirectoryReader reader =
new RedactionFilterDirectoryReader(
DirectoryReader.open(indexWriter.get(), false, false), fieldRedactionMetadataStore);
this.searcherManager = new SearcherManager(reader, null);
OpenSearchDirectoryReader openSearchDirectoryReader =
OpenSearchDirectoryReader.wrap(
reader,
ShardId.fromString("[shard-index][%d]".formatted(UUID.fromString(id).hashCode())));
this.searcherManager = new SearcherManager(openSearchDirectoryReader, null);

scheduledCommit.scheduleWithFixedDelay(
() -> {
Expand Down

0 comments on commit e64b486

Please sign in to comment.