Skip to content

Commit

Permalink
update SearchQueryIT to properly test wildcard query case sensitivity
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Dec 6, 2022
1 parent 1081116 commit 378310b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2092,8 +2092,14 @@ public void testWildcardQueryNormalizationOnTextField() {
refresh();

{
// test default case insensitivity: false
WildcardQueryBuilder wildCardQuery = wildcardQuery("field1", "Bb*");
SearchResponse searchResponse = client().prepareSearch().setQuery(wildCardQuery).get();
assertHitCount(searchResponse, 0L);

// test case insensitivity set to true
wildCardQuery = wildcardQuery("field1", "Bb*").caseInsensitive(true);
searchResponse = client().prepareSearch().setQuery(wildCardQuery).get();
assertHitCount(searchResponse, 1L);

wildCardQuery = wildcardQuery("field1", "bb*");
Expand Down

0 comments on commit 378310b

Please sign in to comment.