public abstract class SpatialFieldBridge extends Object implements MetadataProvidingFieldBridge
Modifier and Type | Field and Description |
---|---|
protected String |
latitudeField |
protected String |
latitudeIndexedFieldName |
protected String |
longitudeField |
protected String |
longitudeIndexedFieldName |
Constructor and Description |
---|
SpatialFieldBridge() |
Modifier and Type | Method and Description |
---|---|
static String |
capitalize(String name) |
void |
configureFieldMetadata(String name,
FieldMetadataBuilder builder)
Allows this bridge to expose meta-data about the fields it creates.
|
protected Double |
getLatitude(Object value) |
protected Double |
getLongitude(Object value) |
abstract void |
set(String name,
Object value,
Document document,
LuceneOptions luceneOptions)
Manipulate the document to index the given value.
|
protected String latitudeField
protected String longitudeField
protected String latitudeIndexedFieldName
protected String longitudeIndexedFieldName
public abstract void set(String name, Object value, 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 void configureFieldMetadata(String name, FieldMetadataBuilder builder)
MetadataProvidingFieldBridge
configureFieldMetadata
in interface MetadataProvidingFieldBridge
name
- The default field name; Should be used consistently with
FieldBridge.set(String, Object, org.apache.lucene.document.Document, LuceneOptions)
.builder
- Builder for exposing field-related meta-dataCopyright © 2006-2017 Red Hat, Inc. All Rights Reserved