Class Queries
- java.lang.Object
-
- org.elasticsearch.common.lucene.search.Queries
-
public class Queries extends Object
-
-
Constructor Summary
Constructors Constructor Description Queries()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QueryapplyMinimumShouldMatch(BooleanQuery query, String minimumShouldMatch)static intcalculateMinShouldMatch(int optionalClauseCount, String spec)static BooleanQueryfiltered(Query query, Query filter)static QueryfixNegativeQueryIfNeeded(Query q)static QuerymaybeApplyMinimumShouldMatch(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 QuerynewLenientFieldQuery(String field, RuntimeException e)static QuerynewMatchAllQuery()static QuerynewMatchNoDocsQuery(String reason)Return a query that matches no document.static QuerynewNestedFilter()static QuerynewNonNestedFilter(Version indexVersionCreated)Creates a new non-nested docs querystatic QuerynewUnmappedFieldQuery(String field)static QuerynewUnmappedFieldsQuery(Collection<String> fields)static Querynot(Query q)Return a query that matches all documents but those that match the given query.
-
-
-
Method Detail
-
newMatchAllQuery
public static Query newMatchAllQuery()
-
newMatchNoDocsQuery
public static Query newMatchNoDocsQuery(String reason)
Return a query that matches no document.
-
newUnmappedFieldsQuery
public static Query newUnmappedFieldsQuery(Collection<String> fields)
-
newLenientFieldQuery
public static Query newLenientFieldQuery(String field, RuntimeException e)
-
newNestedFilter
public static Query newNestedFilter()
-
newNonNestedFilter
public static Query newNonNestedFilter(Version indexVersionCreated)
Creates a new non-nested docs query- Parameters:
indexVersionCreated- the index version created since newer indices can identify a parent field more efficiently
-
filtered
public static BooleanQuery filtered(@Nullable Query query, @Nullable Query filter)
-
not
public static Query not(Query q)
Return a query that matches all documents but those that match the given query.
-
applyMinimumShouldMatch
public static Query applyMinimumShouldMatch(BooleanQuery query, @Nullable String minimumShouldMatch)
-
maybeApplyMinimumShouldMatch
public static Query maybeApplyMinimumShouldMatch(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
public static int calculateMinShouldMatch(int optionalClauseCount, String spec)
-
-