public final class NumericFieldUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.apache.lucene.search.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 org.apache.lucene.search.Query |
createNumericRangeQuery(String fieldName,
Object from,
Object to,
boolean includeLower,
boolean includeUpper) |
static boolean |
isNumericContainerOrNumericFieldBridge(FieldBridge fieldBridge)
Indicates whether the considered
FieldBridge, or its element bridge,
is a numeric one. |
static boolean |
isNumericFieldBridge(FieldBridge fieldBridge)
Indicates whether the considered
FieldBridge is a numeric one. |
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 org.apache.lucene.search.Query createNumericRangeQuery(String fieldName, Object from, Object to, boolean includeLower, boolean includeUpper)
public static org.apache.lucene.search.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 matchQuerypublic 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.
Note that this is currently only used by the Infinispan backend as a fallback and it should be used with a lot
of caution as it does not take into account backend specific behaviors.
For instance, when indexing on Elasticsearch, Dates require a keyword range query.
This should match the default FieldBridge used for each type.value - on Objectpublic static boolean isNumericFieldBridge(FieldBridge fieldBridge)
FieldBridge is a numeric one.fieldBridge - the considered FieldBridgeFieldBridge is a numeric FieldBridgepublic static boolean isNumericContainerOrNumericFieldBridge(FieldBridge fieldBridge)
FieldBridge, or its element bridge,
is a numeric one.fieldBridge - the considered FieldBridgeFieldBridge is a numeric FieldBridgeCopyright © 2006–2017 Hibernate. All rights reserved.