Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
  • Loading branch information
bowenlan-amzn committed Jul 30, 2024
1 parent 3cd735e commit b9bf2d4
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,13 @@ private void fetch(TermsLookup termsLookup, Client client, ActionListener<List<O
}
client.get(getRequest, ActionListener.delegateFailure(actionListener, (delegatedListener, getResponse) -> {
List<Object> terms = new ArrayList<>();
terms.addAll(getResponse.getField(termsLookup.path()).getValues());
if (getResponse.isSourceEmpty() == false) { // extract terms only if the doc source exists
List<Object> extractedValues = XContentMapValues.extractRawValues(termsLookup.path(), getResponse.getSourceAsMap());
terms.addAll(extractedValues);
if (termsLookup.store()) {
terms.addAll(getResponse.getField(termsLookup.path()).getValues());

Check warning on line 534 in server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java#L534

Added line #L534 was not covered by tests
} else {
if (getResponse.isSourceEmpty() == false) { // extract terms only if the doc source exists
List<Object> extractedValues = XContentMapValues.extractRawValues(termsLookup.path(), getResponse.getSourceAsMap());
terms.addAll(extractedValues);
}
}
delegatedListener.onResponse(terms);
}));
Expand Down

0 comments on commit b9bf2d4

Please sign in to comment.