org.hibernate.search.bridge.builtin
Class NumericFieldBridge

java.lang.Object
  extended by org.hibernate.search.bridge.builtin.NumericFieldBridge
All Implemented Interfaces:
FieldBridge, TwoWayFieldBridge
Direct Known Subclasses:
DoubleNumericFieldBridge, FloatNumericFieldBridge, IntegerNumericFieldBridge, LongNumericFieldBridge

public abstract class NumericFieldBridge
extends Object
implements TwoWayFieldBridge

Bridge to index numeric values using a Trie structure (multiple terms representing different precisions)

Author:
Gustavo Fernandes

Constructor Summary
NumericFieldBridge()
           
 
Method Summary
 String objectToString(Object object)
          Convert the object representation to a string.
 void set(String name, Object value, Document document, LuceneOptions luceneOptions)
          Manipulate the document to index the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.search.bridge.TwoWayFieldBridge
get
 

Constructor Detail

NumericFieldBridge

public NumericFieldBridge()
Method Detail

set

public void set(String name,
                Object value,
                Document document,
                LuceneOptions luceneOptions)
Description copied from interface: FieldBridge
Manipulate the document to index the given value.

A common implementation is to add a Field with the given name to document following the parameters luceneOptions if the value is not null. {code} String fieldValue = convertToString(value); luceneOptions.addFieldToDocument(name, fieldValue, document); {code}

Specified by:
set in interface FieldBridge
Parameters:
name - The field to add to the Lucene document
value - The actual value to index
document - The Lucene document into which we want to index the value.
luceneOptions - Contains the parameters used for adding value to the Lucene document.

objectToString

public String objectToString(Object object)
Description copied from interface: TwoWayFieldBridge
Convert the object representation to a string.

Specified by:
objectToString in interface TwoWayFieldBridge
Parameters:
object - The object to index.
Returns:
string (index) representation of the specified object. Must not be null, but can be empty.


Copyright © 2006-2013 Red Hat, Inc. All Rights Reserved