|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlux.index.field.FieldDefinition
public abstract class FieldDefinition
represents a field in the index corresponding to some XML content.
An XmlField has a name, which may be configured, but must remain the same for all uses
of a single index.
XmlField provides methods for retrieving Lucene field configuration, and for retrieving values
from the XmlIndexer to be passed to Lucene.
see IndexConfiguration for a list of current built-in fields.
| Nested Class Summary | |
|---|---|
static class |
FieldDefinition.Type
Represents the type of data fed to the index for a given field. |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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 renamed
public 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.| Method Detail |
|---|
public boolean isRenameable()
public Iterable<? extends org.apache.lucene.index.IndexableField> getFieldValues(XmlIndexer indexer)
indexer - the indexer that holds the field values
IndexableFieldspublic Iterable<?> getValues(XmlIndexer indexer)
indexer - the indexer that holds the field values
public 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.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||