Class Queries
java.lang.Object
org.elasticsearch.common.lucene.search.Queries
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.search.Query
applyMinimumShouldMatch
(org.apache.lucene.search.BooleanQuery query, String minimumShouldMatch) static int
calculateMinShouldMatch
(int optionalClauseCount, String spec) static org.apache.lucene.search.BooleanQuery
filtered
(org.apache.lucene.search.Query query, org.apache.lucene.search.Query filter) static org.apache.lucene.search.Query
fixNegativeQueryIfNeeded
(org.apache.lucene.search.Query q) static org.apache.lucene.search.Query
maybeApplyMinimumShouldMatch
(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.Query
newLenientFieldQuery
(String field, RuntimeException e) static org.apache.lucene.search.Query
static org.apache.lucene.search.Query
newMatchNoDocsQuery
(String reason) Return a query that matches no document.static org.apache.lucene.search.Query
static org.apache.lucene.search.Query
newNonNestedFilter
(Version indexVersionCreated) Creates a new non-nested docs querystatic org.apache.lucene.search.Query
newUnmappedFieldQuery
(String field) static org.apache.lucene.search.Query
newUnmappedFieldsQuery
(Collection<String> fields) 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.
-
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
public static org.apache.lucene.search.Query newNestedFilter() -
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
-