Class RangeQuery

    • Constructor Summary

      Constructors 
      Constructor Description
      RangeQuery​(org.apache.lucene.index.Term lowerTerm, org.apache.lucene.index.Term upperTerm, boolean inclusive, int transform, org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
      Creates a new RangeQuery.
      RangeQuery​(org.apache.lucene.index.Term lowerTerm, org.apache.lucene.index.Term upperTerm, boolean inclusive, org.apache.jackrabbit.core.query.lucene.PerQueryCache cache)
      Creates a new RangeQuery.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.lucene.search.Weight createWeight​(org.apache.lucene.search.Searcher searcher)
      Creates the Weight for this query.
      void extractTerms​(Set<org.apache.lucene.index.Term> terms)
      org.apache.lucene.search.Query rewrite​(org.apache.lucene.index.IndexReader reader)
      Tries to rewrite this query into a standard lucene RangeQuery.
      void setTransformation​(int transformation)
      Sets the transformation.
      String toString​(String field)
      Returns a string representation of this query.
      • Methods inherited from class org.apache.lucene.search.Query

        clone, combine, equals, getBoost, getSimilarity, hashCode, mergeBooleanQueries, setBoost, toString, weight
    • Constructor Detail

      • RangeQuery

        public RangeQuery​(org.apache.lucene.index.Term lowerTerm,
                          org.apache.lucene.index.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​(org.apache.lucene.index.Term lowerTerm,
                          org.apache.lucene.index.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 org.apache.lucene.search.Query rewrite​(org.apache.lucene.index.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 org.apache.lucene.search.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 org.apache.lucene.search.Weight createWeight​(org.apache.lucene.search.Searcher searcher)
        Creates the Weight for this query.
        Overrides:
        createWeight in class org.apache.lucene.search.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 org.apache.lucene.search.Query
        Parameters:
        field - the field name for which to create a string representation.
        Returns:
        a string representation of this query.
      • extractTerms

        public void extractTerms​(Set<org.apache.lucene.index.Term> terms)
        Overrides:
        extractTerms in class org.apache.lucene.search.Query