java.lang.Object
org.elasticsearch.common.lucene.search.Queries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.search.QueryapplyMinimumShouldMatch(org.apache.lucene.search.BooleanQuery query, String minimumShouldMatch) static intcalculateMinShouldMatch(int optionalClauseCount, String spec) static org.apache.lucene.search.BooleanQueryfiltered(org.apache.lucene.search.Query query, org.apache.lucene.search.Query filter) static org.apache.lucene.search.QueryfixNegativeQueryIfNeeded(org.apache.lucene.search.Query q) static org.apache.lucene.search.QuerymaybeApplyMinimumShouldMatch(org.apache.lucene.search.Query query, String minimumShouldMatch) Potentially apply minimum should match value if we have a query that it can be applied to, otherwise return the original query.static org.apache.lucene.search.QuerynewLenientFieldQuery(String field, RuntimeException e) static org.apache.lucene.search.Querystatic org.apache.lucene.search.QuerynewMatchNoDocsQuery(String reason) Return a query that matches no document.static org.apache.lucene.search.QuerynewNestedFilter(IndexVersion indexVersionCreated) Creates a new nested docs querystatic org.apache.lucene.search.QuerynewNonNestedFilter(IndexVersion indexVersionCreated) Creates a new non-nested docs querystatic org.apache.lucene.search.QuerynewUnmappedFieldQuery(String field) static org.apache.lucene.search.QuerynewUnmappedFieldsQuery(Collection<String> fields) static org.apache.lucene.search.Querynot(org.apache.lucene.search.Query q) Return a query that matches all documents but those that match the given query.
-
Constructor Details
-
Queries
public Queries()
-
-
Method Details
-
newMatchAllQuery
public static org.apache.lucene.search.Query newMatchAllQuery() -
newMatchNoDocsQuery
Return a query that matches no document. -
newUnmappedFieldQuery
-
newUnmappedFieldsQuery
-
newLenientFieldQuery
-
newNestedFilter
Creates a new nested docs query- Parameters:
indexVersionCreated- the index version created since newer indices can identify a parent field more efficiently
-
newNonNestedFilter
Creates a new non-nested docs query- Parameters:
indexVersionCreated- the index version created since newer indices can identify a parent field more efficiently
-
filtered
-
not
public static org.apache.lucene.search.Query not(org.apache.lucene.search.Query q) Return a query that matches all documents but those that match the given query. -
fixNegativeQueryIfNeeded
public static org.apache.lucene.search.Query fixNegativeQueryIfNeeded(org.apache.lucene.search.Query q) -
applyMinimumShouldMatch
-
maybeApplyMinimumShouldMatch
public static org.apache.lucene.search.Query maybeApplyMinimumShouldMatch(org.apache.lucene.search.Query query, @Nullable String minimumShouldMatch) Potentially apply minimum should match value if we have a query that it can be applied to, otherwise return the original query. -
calculateMinShouldMatch
-