Class NumericRangeFilterBuilder
- java.lang.Object
-
- org.apache.lucene.queryparser.xml.builders.NumericRangeFilterBuilder
-
- All Implemented Interfaces:
FilterBuilder
public class NumericRangeFilterBuilder extends java.lang.Object implements FilterBuilder
Creates aNumericRangeFilter
. The table below specifies the required attributes and the defaults if optional attributes are omitted. For more detail on what each of the attributes actually do, consult the documentation forNumericRangeFilter
:Attribute name Values Required Default fieldName String Yes N/A lowerTerm Specified by type Yes N/A upperTerm Specified by type Yes N/A type int, long, float, double No int includeLower true, false No true includeUpper true, false No true precisionStep Integer No 4
-
-
Constructor Summary
Constructors Constructor Description NumericRangeFilterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filter
getFilter(org.w3c.dom.Element e)
void
setStrictMode(boolean strictMode)
Specifies how thisNumericRangeFilterBuilder
will handle errors.
-
-
-
Method Detail
-
setStrictMode
public void setStrictMode(boolean strictMode)
Specifies how thisNumericRangeFilterBuilder
will handle errors. If this is set to true,getFilter(Element)
will throw aParserException
if it is unable to parse the lowerTerm or upperTerm into the appropriate numeric type. If this is set to false, then this exception will be silently ignored and the resulting filter will not match any documents. Defaults to false.
-
getFilter
public Filter getFilter(org.w3c.dom.Element e) throws ParserException
- Specified by:
getFilter
in interfaceFilterBuilder
- Throws:
ParserException
-
-