diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchBoolPrefixQuery.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchBoolPrefixQuery.java index e686f50082..754a09259d 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchBoolPrefixQuery.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchBoolPrefixQuery.java @@ -7,6 +7,7 @@ import com.google.common.collect.ImmutableMap; import org.opensearch.index.query.MatchBoolPrefixQueryBuilder; +import org.opensearch.index.query.Operator; import org.opensearch.index.query.QueryBuilders; /** @@ -28,6 +29,8 @@ public MatchBoolPrefixQuery() { (b, v) -> b.fuzzyTranspositions(Boolean.parseBoolean(v.stringValue()))) .put("fuzzy_rewrite", (b, v) -> b.fuzzyRewrite(v.stringValue())) .put("boost", (b, v) -> b.boost(Float.parseFloat(v.stringValue()))) + .put("analyzer", (b, v) -> b.analyzer(v.stringValue())) + .put("operator", (b,v) -> b.operator(Operator.fromString(v.stringValue()))) .build()); } diff --git a/opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchBoolPrefixQueryTest.java b/opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchBoolPrefixQueryTest.java index dda1a201be..00cf3158c4 100644 --- a/opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchBoolPrefixQueryTest.java +++ b/opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchBoolPrefixQueryTest.java @@ -45,7 +45,10 @@ static Stream> generateValidData() { dsl.namedArgument("fuzzy_transpositions", DSL.literal("true")), dsl.namedArgument("fuzzy_rewrite", DSL.literal("constant_score")), dsl.namedArgument("minimum_should_match", DSL.literal("3")), - dsl.namedArgument("boost", DSL.literal("1")) + dsl.namedArgument("boost", DSL.literal("1")), + dsl.namedArgument("analyzer", DSL.literal("simple")), + dsl.namedArgument("operator", DSL.literal("Or")), + dsl.namedArgument("operator", DSL.literal("and")) ).stream().map(arg -> List.of(field, query, arg)); }