diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/SimpleQueryStringQuery.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/SimpleQueryStringQuery.java index 109236db8e..2e75c8c178 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/SimpleQueryStringQuery.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/SimpleQueryStringQuery.java @@ -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; @@ -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())