Skip to content

Commit

Permalink
Update SimpleQueryStringQuery to use ImmutableMap.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Jun 6, 2022
1 parent 015aa06 commit 9814fa4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.google.common.collect.ImmutableMap;
import java.util.Iterator;
import java.util.Objects;
import java.util.stream.Collectors;
import org.opensearch.index.query.Operator;
import org.opensearch.index.query.QueryBuilder;
import org.opensearch.index.query.QueryBuilders;
Expand Down Expand Up @@ -60,7 +59,7 @@ public QueryBuilder build(FunctionExpression func) {
.tupleValue()
.entrySet()
.stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().floatValue()));
.collect(ImmutableMap.toImmutableMap(e -> e.getKey(), e -> e.getValue().floatValue()));

SimpleQueryStringBuilder queryBuilder = createQueryBuilder(null,
query.getValue().valueOf(null).stringValue())
Expand Down

0 comments on commit 9814fa4

Please sign in to comment.