use of org.apache.lucene.queries.ExtendedCommonTermsQuery in project elasticsearch by elastic.
the class CommonTermsQueryBuilderTests method testCommonTermsQuery1.
public void testCommonTermsQuery1() throws IOException {
String query = copyToStringFromClasspath("/org/elasticsearch/index/query/commonTerms-query1.json");
Query parsedQuery = parseQuery(query).toQuery(createShardContext());
assertThat(parsedQuery, instanceOf(ExtendedCommonTermsQuery.class));
ExtendedCommonTermsQuery ectQuery = (ExtendedCommonTermsQuery) parsedQuery;
assertThat(ectQuery.getHighFreqMinimumNumberShouldMatchSpec(), nullValue());
assertThat(ectQuery.getLowFreqMinimumNumberShouldMatchSpec(), equalTo("2"));
}
use of org.apache.lucene.queries.ExtendedCommonTermsQuery in project elasticsearch by elastic.
the class CommonTermsQueryBuilderTests method testCommonTermsQuery4.
// see #11730
public void testCommonTermsQuery4() throws IOException {
boolean disableCoord = randomBoolean();
Query parsedQuery = parseQuery(commonTermsQuery("field", "text").disableCoord(disableCoord)).toQuery(createShardContext());
assertThat(parsedQuery, instanceOf(ExtendedCommonTermsQuery.class));
ExtendedCommonTermsQuery ectQuery = (ExtendedCommonTermsQuery) parsedQuery;
assertThat(ectQuery.isCoordDisabled(), equalTo(disableCoord));
}
Aggregations