public class NullEncodingTwoWayFieldBridge extends Object implements TwoWayFieldBridge
Constructor and Description |
---|
NullEncodingTwoWayFieldBridge(TwoWayFieldBridge fieldBridge,
NullMarkerCodec nullTokenCodec) |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Query |
buildNullQuery(String fieldName) |
Object |
get(String name,
org.apache.lucene.document.Document document)
Build the element object from the
Document |
String |
objectToString(Object object)
Convert the object representation to a string.
|
void |
set(String name,
Object value,
org.apache.lucene.document.Document document,
LuceneOptions luceneOptions)
Manipulate the document to index the given value.
|
TwoWayFieldBridge |
unwrap() |
public NullEncodingTwoWayFieldBridge(TwoWayFieldBridge fieldBridge, NullMarkerCodec nullTokenCodec)
public Object get(String name, org.apache.lucene.document.Document document)
TwoWayFieldBridge
Document
get
in interface TwoWayFieldBridge
name
- field namedocument
- documentpublic String objectToString(Object object)
TwoWayFieldBridge
objectToString
in interface TwoWayFieldBridge
object
- The object to index.null
, but
can be empty.public TwoWayFieldBridge unwrap()
public void set(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
FieldBridge
A common implementation is to add a Field with the given name
to document
following
the parameters luceneOptions
if the value
is not null
.
String fieldValue = convertToString(value);
luceneOptions.addFieldToDocument(name, fieldValue, document);
set
in interface FieldBridge
name
- The field to add to the Lucene documentvalue
- The actual value to indexdocument
- The Lucene document into which we want to index the value.luceneOptions
- Contains the parameters used for adding value
to
the Lucene document.public org.apache.lucene.search.Query buildNullQuery(String fieldName)
Copyright © 2006–2016 Hibernate. All rights reserved.