## org.apache.lucene.search
Class ConstantScoreRangeQuery

    java.lang.Object
      org.apache.lucene.search.Query
          org.apache.lucene.search.MultiTermQuery
              org.apache.lucene.search.TermRangeQuery
                  org.apache.lucene.search.ConstantScoreRangeQuery

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

Deprecated. Use `TermRangeQuery` for term ranges or `NumericRangeQuery` for numeric ranges instead. This class will be removed in Lucene 3.0.

    public class ConstantScoreRangeQuery

extends TermRangeQuery

A range query that returns a constant score equal to its boost for all documents in the exclusive range of terms.

It does not have an upper bound on the number of clauses covered in the range.

This query matches the documents looking for terms that fall into the supplied range according to `String.compareTo(String)`. It is not intended for numerical ranges, use `NumericRangeQuery` instead.

This query is hardwired to `MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT`. If you want to change this, use `TermRangeQuery` instead.

Version:
  $Id: ConstantScoreRangeQuery.java 797694 2009-07-25 00:03:33Z mikemccand $
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.lucene.search.MultiTermQuery
`MultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod`

Field Summary

Fields inherited from class org.apache.lucene.search.MultiTermQuery
`CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE, term`

Constructor Summary
`ConstantScoreRangeQuery(java.lang.String fieldName, java.lang.String lowerVal, java.lang.String upperVal, boolean includeLower, boolean includeUpper)` Deprecated.
`ConstantScoreRangeQuery(java.lang.String fieldName, java.lang.String lowerVal, java.lang.String upperVal, boolean includeLower, boolean includeUpper, java.text.Collator collator)` Deprecated.

Method Summary
`java.lang.String` `getLowerVal()` Deprecated.
`java.lang.String` `getUpperVal()` Deprecated.
`void` `setRewriteMethod(MultiTermQuery.RewriteMethod method)` Deprecated. Changes of mode are not supported by this class (fixed to constant score rewrite mode)

Methods inherited from class org.apache.lucene.search.TermRangeQuery
`equals, getCollator, getEnum, getField, getLowerTerm, getUpperTerm, hashCode, includesLower, includesUpper, toString`

Methods inherited from class org.apache.lucene.search.MultiTermQuery
`clearTotalNumberOfTerms, getRewriteMethod, getTerm, getTotalNumberOfTerms, incTotalNumberOfTerms, rewrite`

Methods inherited from class org.apache.lucene.search.Query
`clone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ConstantScoreRangeQuery

    public ConstantScoreRangeQuery(java.lang.String fieldName,
                                   java.lang.String lowerVal,
                                   java.lang.String upperVal,
                                   boolean includeLower,
                                   boolean includeUpper)

  Deprecated.

### ConstantScoreRangeQuery

    public ConstantScoreRangeQuery(java.lang.String fieldName,
                                   java.lang.String lowerVal,
                                   java.lang.String upperVal,
                                   boolean includeLower,
                                   boolean includeUpper,
                                   java.text.Collator collator)

  Deprecated.

Method Detail

### getLowerVal

    public java.lang.String getLowerVal()

  Deprecated.

### getUpperVal

    public java.lang.String getUpperVal()

  Deprecated.

### setRewriteMethod

    public void setRewriteMethod(MultiTermQuery.RewriteMethod method)

  Deprecated.
  Changes of mode are not supported by this class (fixed to constant score rewrite mode)

  Overrides:
    `setRewriteMethod` in class `MultiTermQuery`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.