java.lang.Object
org.elasticsearch.common.lucene.search.Queries

public class Queries extends Object
  • Constructor Details

    • Queries

      public Queries()
  • Method Details

    • newMatchAllQuery

      public static org.apache.lucene.search.Query newMatchAllQuery()
    • newMatchNoDocsQuery

      public static org.apache.lucene.search.Query newMatchNoDocsQuery(String reason)
      Return a query that matches no document.
    • newUnmappedFieldQuery

      public static org.apache.lucene.search.Query newUnmappedFieldQuery(String field)
    • newUnmappedFieldsQuery

      public static org.apache.lucene.search.Query newUnmappedFieldsQuery(Collection<String> fields)
    • newLenientFieldQuery

      public static org.apache.lucene.search.Query newLenientFieldQuery(String field, RuntimeException e)
    • newNestedFilter

      public static org.apache.lucene.search.Query newNestedFilter()
    • newNonNestedFilter

      public static org.apache.lucene.search.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 org.apache.lucene.search.BooleanQuery filtered(@Nullable org.apache.lucene.search.Query query, @Nullable org.apache.lucene.search.Query filter)
    • 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

      public static org.apache.lucene.search.Query applyMinimumShouldMatch(org.apache.lucene.search.BooleanQuery query, @Nullable String minimumShouldMatch)
    • 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

      public static int calculateMinShouldMatch(int optionalClauseCount, String spec)