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(org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.document.Field.Store isStored,
FieldDefinition.Type type)
creates a field definition without any special role
|
FieldDefinition(FieldRole role,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.document.Field.Store isStored,
FieldDefinition.Type type)
construct a field definition fulfilling a specific role known to the indexer and optimizer
|
FieldDefinition(FieldRole role,
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() |
FieldRole |
getFieldRole() |
Iterable<? extends org.apache.lucene.index.IndexableField> |
getFieldValues(XmlIndexer indexer)
Wraps the values as Field, which includes the values and the Lucene indexing options.
|
String |
getName() |
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() |
void |
setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer) |
void |
setName(String luceneFieldName) |
String |
toString() |
public FieldDefinition(FieldRole role, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Field.Store isStored, FieldDefinition.Type type, boolean renameable)
role - the role of the field; may be null if the field has no special role.analyzer - 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(FieldRole role, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.document.Field.Store isStored, FieldDefinition.Type type)
role - the role of the fieldanalyzer - the analyzer associated with the field. This will
be used to analyze string field values, and to analyze queries.isStored - whether the field values are to be storedtype - the type of the field values: STRING, TOKENS, INT.public FieldDefinition(org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.document.Field.Store isStored,
FieldDefinition.Type type)
analyzer - isStored - type - 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 FieldDefinition.Type getType()
public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
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.public FieldRole getFieldRole()
public String getName()
Copyright © 2013. All Rights Reserved.