public class Queries extends Object
  • Constructor Details

    • Queries

      public Queries()
  • Method Details

    • newMatchAllQuery

      public static newMatchAllQuery()
    • newMatchNoDocsQuery

      public static newMatchNoDocsQuery(String reason)
      Return a query that matches no document.
    • newUnmappedFieldQuery

      public static newUnmappedFieldQuery(String field)
    • newUnmappedFieldsQuery

      public static newUnmappedFieldsQuery(Collection<String> fields)
    • newLenientFieldQuery

      public static newLenientFieldQuery(String field, RuntimeException e)
    • newNestedFilter

      public static newNestedFilter()
    • newNonNestedFilter

      public static newNonNestedFilter(Version indexVersionCreated)
      Creates a new non-nested docs query
      indexVersionCreated - the index version created since newer indices can identify a parent field more efficiently
    • filtered

      public static filtered(@Nullable query, @Nullable filter)
    • not

      public static not( q)
      Return a query that matches all documents but those that match the given query.
    • fixNegativeQueryIfNeeded

      public static fixNegativeQueryIfNeeded( q)
    • applyMinimumShouldMatch

      public static applyMinimumShouldMatch( query, @Nullable String minimumShouldMatch)
    • maybeApplyMinimumShouldMatch

      public static maybeApplyMinimumShouldMatch( 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)