diff --git a/server/src/test/java/org/opensearch/index/query/SimpleQueryStringBuilderTests.java b/server/src/test/java/org/opensearch/index/query/SimpleQueryStringBuilderTests.java index 773b08b9f4580..0c713a9e832eb 100644 --- a/server/src/test/java/org/opensearch/index/query/SimpleQueryStringBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/SimpleQueryStringBuilderTests.java @@ -316,8 +316,10 @@ protected void doAssertLuceneQuery(SimpleQueryStringBuilder queryBuilder, Query if (disjunct instanceof BoostQuery) { termQuery = ((BoostQuery) disjunct).getQuery(); } - if (termQuery instanceof TermQuery) { - TermQuery inner = (TermQuery) termQuery; + if (termQuery instanceof TermQuery || termQuery instanceof IndexOrDocValuesQuery) { + TermQuery inner; + if (termQuery instanceof IndexOrDocValuesQuery) inner = (TermQuery) ((IndexOrDocValuesQuery) termQuery).getIndexQuery(); + else inner = (TermQuery) termQuery; assertThat(inner.getTerm().bytes().toString(), is(inner.getTerm().bytes().toString().toLowerCase(Locale.ROOT))); } else { assertThat(termQuery, instanceOf(MatchNoDocsQuery.class)); diff --git a/server/src/test/java/org/opensearch/index/search/MultiMatchQueryTests.java b/server/src/test/java/org/opensearch/index/search/MultiMatchQueryTests.java index 3042c488fa80c..7c2add86cb962 100644 --- a/server/src/test/java/org/opensearch/index/search/MultiMatchQueryTests.java +++ b/server/src/test/java/org/opensearch/index/search/MultiMatchQueryTests.java @@ -364,6 +364,6 @@ public void testKeywordSplitQueriesOnWhitespace() throws IOException { ), 0.0f ); - assertThat(query, equalTo(expected)); + assertThat(expected, equalTo(query)); } }