Class RangeQuery

    • Constructor Detail

      • RangeQuery

        public RangeQuery​(Term lowerTerm,
                          Term upperTerm,
                          boolean inclusive,
                          org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
        Creates a new RangeQuery. The lower or the upper term may be null, but not both!
        Parameters:
        lowerTerm - the lower term of the interval, or null
        upperTerm - the upper term of the interval, or null.
        inclusive - if true the interval is inclusive.
      • RangeQuery

        public RangeQuery​(Term lowerTerm,
                          Term upperTerm,
                          boolean inclusive,
                          int transform,
                          org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
        Creates a new RangeQuery. The lower or the upper term may be null, but not both!
        Parameters:
        lowerTerm - the lower term of the interval, or null
        upperTerm - the upper term of the interval, or null.
        inclusive - if true the interval is inclusive.
        transform - how term enums are transformed when read from the index.
    • Method Detail

      • rewrite

        public Query rewrite​(IndexReader reader)
                      throws IOException
        Tries to rewrite this query into a standard lucene RangeQuery. This rewrite might fail with a TooManyClauses exception. If that happens, we use our own implementation.
        Overrides:
        rewrite in class Query
        Parameters:
        reader - the index reader.
        Returns:
        the rewritten query or this query if rewriting is not possible.
        Throws:
        IOException - if an error occurs.
      • createWeight

        public Weight createWeight​(Searcher searcher)
        Creates the Weight for this query.
        Overrides:
        createWeight in class Query
        Parameters:
        searcher - the searcher to use for the Weight.
        Returns:
        the Weigth for this query.
      • toString

        public String toString​(String field)
        Returns a string representation of this query.
        Specified by:
        toString in class Query
        Parameters:
        field - the field name for which to create a string representation.
        Returns:
        a string representation of this query.