org.hibernate.search.bridge.util.impl
Class NumericFieldUtils

java.lang.Object
  extended by org.hibernate.search.bridge.util.impl.NumericFieldUtils

public class NumericFieldUtils
extends Object

Utility class to handle Numeric Fields

Author:
Gustavo Fernandes

Constructor Summary
NumericFieldUtils()
           
 
Method Summary
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 void setNumericValue(Object value, org.apache.lucene.document.NumericField numericField)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericFieldUtils

public NumericFieldUtils()
Method Detail

createNumericRangeQuery

public static org.apache.lucene.search.Query createNumericRangeQuery(String fieldName,
                                                                     Object from,
                                                                     Object to,
                                                                     boolean includeLower,
                                                                     boolean includeUpper)

createExactMatchQuery

public 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. This should perform as efficiently as a TermQuery.

Parameters:
fieldName -
value -
Returns:
the created Query

setNumericValue

public static void setNumericValue(Object value,
                                   org.apache.lucene.document.NumericField numericField)


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved