Skip to content

Commit

Permalink
Fix test case around indexordocvalues query
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Oct 13, 2023
1 parent 198b443 commit b2d0d7f
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

package org.opensearch.index.query;

import org.apache.logging.log4j.Level;
import org.apache.lucene.index.Term;
import org.apache.lucene.queries.ExtendedCommonTermsQuery;
import org.apache.lucene.search.BooleanClause;
Expand All @@ -42,6 +43,7 @@
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.PointRangeQuery;
import org.apache.lucene.search.PrefixQuery;
Expand Down Expand Up @@ -304,10 +306,17 @@ public void testToQueryBooleanPrefixMultipleFields() throws IOException {
} else if (disjunct instanceof PrefixQuery) {
final PrefixQuery secondDisjunct = (PrefixQuery) disjunct;
assertThat(secondDisjunct.getPrefix(), equalTo(new Term(KEYWORD_FIELD_NAME, "foo bar")));
} else {
}
else if (disjunct instanceof IndexOrDocValuesQuery){
final IndexOrDocValuesQuery iodvqDisjunct =
(IndexOrDocValuesQuery) disjunct;
assertThat(iodvqDisjunct.getIndexQuery().toString(), equalTo("mapped_string_2:foo bar*"));
}
else {
throw new AssertionError();
}
assertThat(disjunct, either(instanceOf(BooleanQuery.class)).or(instanceOf(PrefixQuery.class)));
assertThat(disjunct,
either(instanceOf(BooleanQuery.class)).or(instanceOf(PrefixQuery.class)).or(instanceOf(IndexOrDocValuesQuery.class)));
}
}
}
Expand Down

0 comments on commit b2d0d7f

Please sign in to comment.