public final class NumericFieldUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Query |
createExactMatchQuery(String fieldName,
Object value)
Will create a
RangeQuery matching exactly the provided value: lower
and upper value match, and bounds are included. |
static Query |
createNumericRangeQuery(String fieldName,
Object from,
Object to,
boolean includeLower,
boolean includeUpper) |
static boolean |
requiresNumericRangeQuery(Object value)
When the type of
RangeQuery needs to be guessed among keyword based ranges or numeric based
range queries, the parameter type defines the strategy. |
public static Query createNumericRangeQuery(String fieldName, Object from, Object to, boolean includeLower, boolean includeUpper)
public static Query createExactMatchQuery(String fieldName, Object value)
RangeQuery
matching exactly the provided value: lower
and upper value match, and bounds are included. This should perform
as efficiently as a TermQuery.fieldName
- the field name the query targetsvalue
- the value to matchQuery
public static boolean requiresNumericRangeQuery(Object value)
RangeQuery
needs to be guessed among keyword based ranges or numeric based
range queries, the parameter type defines the strategy.
This should match the default FieldBridge
used for each type.value
- on ObjectCopyright © 2006-2015 Red Hat, Inc. All Rights Reserved