public class Queries
extends java.lang.Object
Constructor and Description |
---|
Queries() |
Modifier and Type | Method and Description |
---|---|
static org.apache.lucene.search.Query |
applyMinimumShouldMatch(org.apache.lucene.search.BooleanQuery query,
java.lang.String minimumShouldMatch) |
static int |
calculateMinShouldMatch(int optionalClauseCount,
java.lang.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,
java.lang.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(java.lang.String field,
java.lang.RuntimeException e) |
static org.apache.lucene.search.Query |
newMatchAllQuery() |
static org.apache.lucene.search.Query |
newMatchNoDocsQuery(java.lang.String reason)
Return a query that matches no document.
|
static org.apache.lucene.search.Query |
newNestedFilter() |
static org.apache.lucene.search.Query |
newNonNestedFilter(Version indexVersionCreated)
Creates a new non-nested docs query
|
static org.apache.lucene.search.Query |
newUnmappedFieldQuery(java.lang.String field) |
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.
|
public static org.apache.lucene.search.Query newMatchAllQuery()
public static org.apache.lucene.search.Query newMatchNoDocsQuery(java.lang.String reason)
public static org.apache.lucene.search.Query newUnmappedFieldQuery(java.lang.String field)
public static org.apache.lucene.search.Query newLenientFieldQuery(java.lang.String field, java.lang.RuntimeException e)
public static org.apache.lucene.search.Query newNestedFilter()
public static org.apache.lucene.search.Query newNonNestedFilter(Version indexVersionCreated)
indexVersionCreated
- the index version created since newer indices can identify a parent field more efficientlypublic static org.apache.lucene.search.BooleanQuery filtered(@Nullable org.apache.lucene.search.Query query, @Nullable org.apache.lucene.search.Query filter)
public static org.apache.lucene.search.Query not(org.apache.lucene.search.Query q)
public static org.apache.lucene.search.Query fixNegativeQueryIfNeeded(org.apache.lucene.search.Query q)
public static org.apache.lucene.search.Query applyMinimumShouldMatch(org.apache.lucene.search.BooleanQuery query, @Nullable java.lang.String minimumShouldMatch)
public static org.apache.lucene.search.Query maybeApplyMinimumShouldMatch(org.apache.lucene.search.Query query, @Nullable java.lang.String minimumShouldMatch)
public static int calculateMinShouldMatch(int optionalClauseCount, java.lang.String spec)