public abstract class AbstractSubTypeFieldType extends FieldType implements SchemaAware
FieldType.
The sub type can be obtained by either specifying the subFieldType attribute or the subFieldSuffix. In the former
case, a new dynamic field will be injected into the schema automatically with the name of FieldType.POLY_FIELD_SEPARATOR.
In the latter case, it will use an existing dynamic field definition to get the type. See the example schema and the
use of the PointType for more details.FieldType.DefaultAnalyzer| Modifier and Type | Field and Description |
|---|---|
protected int |
dynFieldProps |
protected IndexSchema |
schema |
static java.lang.String |
SUB_FIELD_SUFFIX |
static java.lang.String |
SUB_FIELD_TYPE |
protected FieldType |
subType |
protected java.lang.String |
suffix |
protected java.lang.String[] |
suffixes |
analyzer, args, falseProperties, log, POLY_FIELD_SEPARATOR, properties, queryAnalyzer, trueProperties, typeNameBINARY, INDEXED, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, propertyMap, propertyNames, REQUIRED, SORT_MISSING_FIRST, SORT_MISSING_LAST, STORE_TERMOFFSETS, STORE_TERMPOSITIONS, STORE_TERMVECTORS, STORED, TOKENIZED| Constructor and Description |
|---|
AbstractSubTypeFieldType() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createSuffixCache(int size) |
org.apache.lucene.search.Query |
getFieldQuery(QParser parser,
SchemaField field,
java.lang.String externalVal)
Throws UnsupportedOperationException()
|
FieldType |
getSubType() |
void |
inform(IndexSchema schema)
Informs the
IndexSchema provided by the schema
parameter of an event (e.g., a new FieldType was added, etc. |
protected void |
init(IndexSchema schema,
java.util.Map<java.lang.String,java.lang.String> args)
subclasses should initialize themselves with the args provided
and remove valid arguments.
|
(package private) static SchemaField |
registerPolyFieldDynamicPrototype(IndexSchema schema,
FieldType type)
Helper method for creating a dynamic field SchemaField prototype.
|
protected SchemaField |
subField(SchemaField base,
int i) |
createField, createField, createFields, getAnalyzer, getArg, getFieldIndex, getFieldStore, getFieldTermVec, getIndexOptions, getQueryAnalyzer, getRangeQuery, getSortField, getStringSort, getTypeName, getValueSource, getValueSource, hasProperty, indexedToReadable, isMultiValued, isPolyField, isTokenized, multiValuedFieldCache, readableToIndexed, restrictProps, setAnalyzer, setArgs, setQueryAnalyzer, setTypeName, storedToIndexed, storedToReadable, toExternal, toInternal, toObject, toString, write, writegetPropertyName, off, on, parseProperties, propertiesToString, propertyNameToIntprotected FieldType subType
public static final java.lang.String SUB_FIELD_SUFFIX
public static final java.lang.String SUB_FIELD_TYPE
protected java.lang.String suffix
protected int dynFieldProps
protected java.lang.String[] suffixes
protected IndexSchema schema
public FieldType getSubType()
protected void init(IndexSchema schema, java.util.Map<java.lang.String,java.lang.String> args)
FieldTypestatic SchemaField registerPolyFieldDynamicPrototype(IndexSchema schema, FieldType type)
SchemaField with
the FieldType given and a name of "*" + FieldType.POLY_FIELD_SEPARATOR + FieldType.typeName
and props of indexed=true, stored=false.schema - the IndexSchematype - The FieldType of the prototype.SchemaFieldpublic void inform(IndexSchema schema)
SchemaAwareIndexSchema provided by the schema
parameter of an event (e.g., a new FieldType was added, etc.inform in interface SchemaAwareschema - The IndexSchema instance that inform of the update to.public org.apache.lucene.search.Query getFieldQuery(QParser parser, SchemaField field, java.lang.String externalVal)
getFieldQuery in class FieldTypeparser - The QParser calling the methodfield - The SchemaField of the field to searchexternalVal - The String representation of the value to searchQuery instance. This implementation returns a TermQuery but overriding queries may notprotected void createSuffixCache(int size)
protected SchemaField subField(SchemaField base, int i)