Skip to content

Commit

Permalink
Add FilterQueryBuilderTest test for match_phrase_prefix with analyzer
Browse files Browse the repository at this point in the history
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
  • Loading branch information
MaxKsyunz committed Jun 21, 2022
1 parent 0fe8f78 commit 0925c1d
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,28 @@ void should_build_match_phrase_prefix_query_with_default_parameters() {
dsl.namedArgument("query", literal("search query")))));
}

@Test
void should_build_match_phrase_prefix_query_with_analyzer() {
assertJsonEquals(
"{\n"
+ " \"match_phrase_prefix\" : {\n"
+ " \"message\" : {\n"
+ " \"query\" : \"search query\",\n"
+ " \"slop\" : 0,\n"
+ " \"zero_terms_query\" : \"NONE\",\n"
+ " \"max_expansions\" : 50,\n"
+ " \"boost\" : 1.0,\n"
+ " \"analyzer\": english\n"
+ " }\n"
+ " }\n"
+ "}",
buildQuery(
dsl.match_phrase_prefix(
dsl.namedArgument("field", literal("message")),
dsl.namedArgument("query", literal("search query")),
dsl.namedArgument("analyzer", literal("english")))));
}

@Test
void cast_to_string_in_filter() {
String json = "{\n"
Expand Down

0 comments on commit 0925c1d

Please sign in to comment.