A range query that returns a constant score equal to its boost for
/// all documents in the range.
///
/// It does not have an upper bound on the number of clauses covered in the range.
///
/// If an endpoint is null, it is said to be "open".
/// Either or both endpoints may be open. Open endpoints may not be exclusive
/// (you can't select all but the first or last term without explicitly specifying the term to exclude.)
///
[Serializable]
public class ConstantScoreRangeQuery : Query
{
private System.String fieldName;
private System.String lowerVal;
private System.String upperVal;
private bool includeLower;
private bool includeUpper;
private CompareInfo collator;
public ConstantScoreRangeQuery(System.String fieldName, System.String lowerVal, System.String upperVal, bool includeLower, bool includeUpper)
{
// do a little bit of normalization...
// open ended range queries should always be inclusive.
if (lowerVal == null)
{
includeLower = true;
}
else if (includeLower && lowerVal.Equals(""))
{
lowerVal = null;
}
if (upperVal == null)
{
includeUpper = true;
}
this.fieldName = String.Intern(fieldName); // intern it, just like terms...
this.lowerVal = lowerVal;
this.upperVal = upperVal;
this.includeLower = includeLower;
this.includeUpper = includeUpper;
}
public ConstantScoreRangeQuery(string fieldName, string lowerVal, string upperVal, bool includeLower, bool includeUpper, CompareInfo collator)
: this(fieldName, lowerVal, upperVal, includeLower, includeUpper)
{
this.collator = collator;
}
///