Class Queries


  • public class Queries
    extends Object
    • Constructor Detail

      • Queries

        public Queries()
    • Method Detail

      • newMatchAllQuery

        public static Query newMatchAllQuery()
      • newMatchNoDocsQuery

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

        public static Query newUnmappedFieldQuery​(String field)
      • 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
      • not

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

        public static Query fixNegativeQueryIfNeeded​(Query q)
      • 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)