public abstract class FieldDefinition extends Object
IndexConfiguration for a list of current built-in fields.| Modifier and Type | Class and Description |
|---|---|
static class |
FieldDefinition.Type
Represents the type of data fed to the index for a given field.
|
| Constructor and Description |
|---|
FieldDefinition(String name,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.document.Field.Store isStored,
FieldDefinition.Type type)
construct an non-renameable field
|
FieldDefinition(String name,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.document.Field.Store isStored,
FieldDefinition.Type type,
boolean renameable)
Represents a Solr/Lucene field
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.analysis.Analyzer |
getAnalyzer() |
String |
getDefaultName()
Note that field name uniqueness is not enforced by the API, but if two fields with different
options share the same name, unpredictable behavior will ensue! This is an historical quirk
of Lucene, which allows
indexing a field in different ways at different times without enforcing a consistent schema.
|
Iterable<? extends org.apache.lucene.index.IndexableField> |
getFieldValues(XmlIndexer indexer)
Wraps the values as Field, which includes the values and the Lucene indexing options.
|
int |
getSolrFieldProperties()
Attempts to guess the Solr field properties (see
FieldProperties) based on the available
information. |
FieldDefinition.Type |
getType() |
Iterable<?> |
getValues(XmlIndexer indexer)
The Solr XmlUpdateProcessor calls this.
|
boolean |
isRenameable() |
boolean |
isSingleValued() |
org.apache.lucene.document.Field.Store |
isStored() |
String |
toString() |
public FieldDefinition(String name, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Field.Store isStored, FieldDefinition.Type type, boolean renameable)
name - the name of the fieldanalyzer - the analyzer associated with the field. This will
be used to analyze string field values, and to analyze queries. If
the field values are not strings (eg if they are a TokenStream), the
analyzer is used only for queries.isStored - whether the field values are to be storedtype - the type of the field values: STRING, TOKENS, INT.renameable - whether the field is allowed to be renamedpublic FieldDefinition(String name, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Field.Store isStored, FieldDefinition.Type type)
name - the name of the fieldanalyzer - the analyzer associated with the field. This will
be used to analyze string field values, and to analyze queries. If
the field values are not strings (eg if they are a TokenStream), the
analyzer is used only for queries.isStored - whether the field values are to be storedtype - the type of the field values: STRING, TOKENS, INT.public boolean isRenameable()
public Iterable<? extends org.apache.lucene.index.IndexableField> getFieldValues(XmlIndexer indexer)
indexer - the indexer that holds the field valuesIndexableFieldspublic Iterable<?> getValues(XmlIndexer indexer)
indexer - the indexer that holds the field valuespublic String getDefaultName()
public FieldDefinition.Type getType()
public org.apache.lucene.analysis.Analyzer getAnalyzer()
public org.apache.lucene.document.Field.Store isStored()
public boolean isSingleValued()
public int getSolrFieldProperties()
FieldProperties) based on the available
information. Subclasses may need to override to get the correct behavior. Norms are omitted from
all fields; all fields except uri are assumed to be multi-valued.Copyright © 2013. All Rights Reserved.