public final class SchemaField extends FieldProperties
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
defaultValue |
(package private) java.lang.String |
name |
(package private) int |
properties |
(package private) boolean |
required |
(package private) FieldType |
type |
BINARY, 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 |
---|
SchemaField(SchemaField prototype,
java.lang.String name)
Create a new SchemaField from an existing one by using all
of the properties of the prototype except the field name.
|
SchemaField(java.lang.String name,
FieldType type)
Create a new SchemaField with the given name and type,
using all the default properties from the type.
|
SchemaField(java.lang.String name,
FieldType type,
int properties,
java.lang.String defaultValue)
Create a new SchemaField with the given name and type,
and with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
(package private) static int |
calcProps(java.lang.String name,
FieldType ft,
java.util.Map<java.lang.String,java.lang.String> props) |
void |
checkFieldCacheSource(QParser parser)
Sanity checks that the properties of this field type are plausible
for a field that may be used to get a FieldCacheSource, throwing
an appropriate exception (including the field name) if it is not.
|
void |
checkSortability()
Sanity checks that the properties of this field type are plausible
for a field that may be used in sorting, throwing an appropriate
exception (including the field name) if it is not.
|
(package private) static SchemaField |
create(java.lang.String name,
FieldType ft,
int props,
java.lang.String defValue)
Create a SchemaField w/ the props specified.
|
(package private) static SchemaField |
create(java.lang.String name,
FieldType ft,
java.util.Map<java.lang.String,java.lang.String> props) |
org.apache.lucene.document.Fieldable |
createField(java.lang.String val,
float boost) |
org.apache.lucene.document.Fieldable[] |
createFields(java.lang.String val,
float boost) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDefaultValue() |
java.lang.String |
getName() |
(package private) int |
getProperties() |
org.apache.lucene.search.SortField |
getSortField(boolean top)
Delegates to the FieldType for this field
|
FieldType |
getType() |
int |
hashCode() |
boolean |
indexed() |
(package private) boolean |
isBinary() |
boolean |
isPolyField()
If true, then use
createFields(String, float) , else use createField(java.lang.String, float) to save an extra allocation |
boolean |
isRequired() |
(package private) boolean |
isTokenized() |
boolean |
multiValued() |
boolean |
omitNorms() |
boolean |
omitPositions() |
boolean |
omitTermFreqAndPositions() |
boolean |
omitTf()
Deprecated.
|
boolean |
sortMissingFirst() |
boolean |
sortMissingLast() |
boolean |
stored() |
boolean |
storeTermOffsets() |
boolean |
storeTermPositions() |
boolean |
storeTermVector() |
java.lang.String |
toString() |
void |
write(TextResponseWriter writer,
java.lang.String name,
org.apache.lucene.document.Fieldable val) |
void |
write(XMLWriter writer,
java.lang.String name,
org.apache.lucene.document.Fieldable val) |
getPropertyName, off, on, parseProperties, propertiesToString, propertyNameToInt
final java.lang.String name
final FieldType type
final int properties
final java.lang.String defaultValue
boolean required
public SchemaField(java.lang.String name, FieldType type)
public SchemaField(SchemaField prototype, java.lang.String name)
public SchemaField(java.lang.String name, FieldType type, int properties, java.lang.String defaultValue)
public java.lang.String getName()
public FieldType getType()
int getProperties()
public boolean indexed()
public boolean stored()
public boolean storeTermVector()
public boolean storeTermPositions()
public boolean storeTermOffsets()
public boolean omitNorms()
@Deprecated public boolean omitTf()
omitTermFreqAndPositions()
public boolean omitTermFreqAndPositions()
public boolean omitPositions()
public boolean multiValued()
public boolean sortMissingFirst()
public boolean sortMissingLast()
public boolean isRequired()
boolean isTokenized()
boolean isBinary()
public org.apache.lucene.document.Fieldable createField(java.lang.String val, float boost)
public org.apache.lucene.document.Fieldable[] createFields(java.lang.String val, float boost)
public boolean isPolyField()
createFields(String, float)
, else use createField(java.lang.String, float)
to save an extra allocationpublic java.lang.String toString()
toString
in class java.lang.Object
public void write(XMLWriter writer, java.lang.String name, org.apache.lucene.document.Fieldable val) throws java.io.IOException
java.io.IOException
public void write(TextResponseWriter writer, java.lang.String name, org.apache.lucene.document.Fieldable val) throws java.io.IOException
java.io.IOException
public org.apache.lucene.search.SortField getSortField(boolean top)
public void checkSortability() throws SolrException
public void checkFieldCacheSource(QParser parser) throws SolrException
static SchemaField create(java.lang.String name, FieldType ft, java.util.Map<java.lang.String,java.lang.String> props)
static SchemaField create(java.lang.String name, FieldType ft, int props, java.lang.String defValue)
name
- The name of the SchemaFieldft
- The FieldType
of the fieldprops
- The props. See calcProps(String, org.apache.solr.schema.FieldType, java.util.Map)
defValue
- The default Value for the fieldcreate(String, FieldType, java.util.Map)
static int calcProps(java.lang.String name, FieldType ft, java.util.Map<java.lang.String,java.lang.String> props)
public java.lang.String getDefaultValue()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object