Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create separate SourceLookup instance per segment slice in SignificantTextAggregatorFactory #8807

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Change InternalSignificantTerms to sum shard-level superset counts only in final reduce ([#8735](https://github.com/opensearch-project/OpenSearch/pull/8735))
- Exclude 'benchmarks' from codecov report ([#8805](https://github.com/opensearch-project/OpenSearch/pull/8805))
- [Refactor] MediaTypeParser to MediaTypeParserRegistry ([#8636](https://github.com/opensearch-project/OpenSearch/pull/8636))
- Create separate SourceLookup instance per segment slice in SignificantTextAggregatorFactory ([#8807](https://github.com/opensearch-project/OpenSearch/pull/8807))

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void testSimpleTimeout() throws Exception {
.get();
assertTrue(searchResponse.isTimedOut());
assertEquals(0, searchResponse.getFailedShards());
assertTrue(numDocs > searchResponse.getHits().getTotalHits().value);
jed326 marked this conversation as resolved.
Show resolved Hide resolved
}

public void testSimpleDoesNotTimeout() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ protected Aggregator createInternal(
: includeExclude.convertToStringFilter(DocValueFormat.RAW, maxRegexLength);

MapStringTermsAggregator.CollectorSource collectorSource = new SignificantTextCollectorSource(
andrross marked this conversation as resolved.
Show resolved Hide resolved
queryShardContext.lookup().source(),
queryShardContext.bigArrays(),
fieldType,
sourceFieldNames,
Expand Down Expand Up @@ -186,13 +185,14 @@ private static class SignificantTextCollectorSource implements MapStringTermsAgg
private ObjectArray<DuplicateByteSequenceSpotter> dupSequenceSpotters;

SignificantTextCollectorSource(
SourceLookup sourceLookup,
BigArrays bigArrays,
MappedFieldType fieldType,
String[] sourceFieldNames,
boolean filterDuplicateText
) {
this.sourceLookup = sourceLookup;
// Create a new SourceLookup instance per aggregator instead of use the shared one from SearchLookup. This is fine because it
// will only be accessed by this Aggregator instance and not anywhere else.
this.sourceLookup = new SourceLookup();
this.bigArrays = bigArrays;
this.fieldType = fieldType;
this.sourceFieldNames = sourceFieldNames;
Expand Down
Loading