public class SchemaField extends Object implements SchemaFieldProperties, Iterable<String>, Externalizable, Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
SchemaField.LowerCaseMode
Enum indicating the lowercase mode.
|
static class |
SchemaField.TokenizeMode
Enum indicating the tokenization mode.
|
static class |
SchemaField.Type
All the valid field types.
|
Modifier and Type | Field and Description |
---|---|
protected String |
suffix |
ACRONYMS_MODE, CACHE_COMPRESSED, COLLATION_COUNTRY, COLLATION_DECOMPOSITION, COLLATION_LANGUAGE, COLLATION_STRENGTH, COLLATION_VARIANT, DATE_RESOLUTION, DECIMAL_PRECISION, DECIMAL_PRECISION_STEP, DECIMAL_SCALE, DEFAULT_ACRONYMS_MODE, DEFAULT_CACHE_COMPRESSED, DEFAULT_CACHE_POLICY, DEFAULT_DATE_RESOLUTION, DEFAULT_DECIMAL_PRECISION, DEFAULT_DECIMAL_PRECISION_STEP, DEFAULT_DECIMAL_SCALE, DEFAULT_FACET_CACHED, DEFAULT_FACET_DISTRIBUTED_MAX_NUM_BUCKETS, DEFAULT_FACET_DISTRIBUTED_MIN_CUTOFF, DEFAULT_FACET_ENUM, DEFAULT_FACET_ENUM_FACTOR, DEFAULT_FACET_ENUM_MAX_TERMS, DEFAULT_FACET_MAX_NUM_BUCKETS, DEFAULT_FACET_MAX_TERMS, DEFAULT_FACET_MIN_CUTOFF, DEFAULT_FACET_OUTLIER_FACTOR, DEFAULT_HIGHLIGHT_ENABLED, DEFAULT_HIGHLIGHT_FRAGMENT, DEFAULT_HIGHLIGHT_FRAGMENT_SIZE, DEFAULT_HIGHLIGHT_MERGE_FRAGMENTS, DEFAULT_HIGHLIGHT_NUM_FRAGMENTS, DEFAULT_HIGHLIGHT_SEPARATOR, DEFAULT_INDEX_MAX_LENGTH, DEFAULT_INDEX_MAX_TOKENS, DEFAULT_INDEX_OMIT_NORMS, DEFAULT_INDEX_PRECISION_STEP, DEFAULT_INDEX_RELEVANCY, DEFAULT_INDEX_TERM_VECTOR, DEFAULT_INDEX_TERM_VECTOR_OFFSETS, DEFAULT_INDEX_TERM_VECTOR_POSITIONS, DEFAULT_INDEX_TOKENIZER, DEFAULT_INDEX_WILDCARDS, DEFAULT_NATURAL_LANGUAGE, DEFAULT_SCOPE_XML_ATTRIBUTES, DEFAULT_STOPWORDS_MODE, DEFAULT_STORE_HIDDEN, DEFAULT_STORE_MAX_CHARS, DEFAULT_SYNONYMS_MODE, DEFAULT_WILDCARD_MAX_LENGTH, DEFAULT_WILDCARD_MAX_PHRASE_TERMS, DEFAULT_WILDCARD_MAX_TERMS, DEFAULT_WILDCARD_MODE, DEFAULT_WILDCARD_STEP, FACET_CACHE_POLICY, FACET_CACHED, FACET_DISTRIBUTED_MAX_NUM_BUCKETS, FACET_DISTRIBUTED_MIN_CUTOFF, FACET_ENUM, FACET_ENUM_FACTOR, FACET_ENUM_MAX_TERMS, FACET_MAX_DISCRETE_BUCKETS, FACET_MAX_NUM_BUCKETS, FACET_MAX_TERMS, FACET_MIN_CUTOFF, FACET_OUTLIER_FACTOR, HIGHLIGHT_ENABLED, HIGHLIGHT_FALLBACK_FIELD, HIGHLIGHT_FRAGMENT, HIGHLIGHT_FRAGMENT_SCOPE, HIGHLIGHT_FRAGMENT_SIZE, HIGHLIGHT_MERGE_FRAGMENTS, HIGHLIGHT_METHOD, HIGHLIGHT_NUM_FRAGMENTS, HIGHLIGHT_SEPARATOR, HIGHLIGHT_WHITELIST, INDEX_MAX_LENGTH, INDEX_MAX_TOKENS, INDEX_OMIT_NORMS, INDEX_PRECISION_STEP, INDEX_RELEVANCY, INDEX_TERM_VECTOR, INDEX_TERM_VECTOR_OFFSETS, INDEX_TERM_VECTOR_POSITIONS, INDEX_TOKENIZER, INDEX_WILDCARDS, JOIN_CACHE_POLICY, NATURAL_LANGUAGE, SCOPE_XML_ATTRIBUTES, SPELLCHECK_FIELD, STOPWORDS_MODE, STORE_HIDDEN, STORE_MAX_CHARS, SYNONYMS_MODE, WILDCARD_MAX_LENGTH, WILDCARD_MAX_PHRASE_TERMS, WILDCARD_MAX_TERMS, WILDCARD_MODE, WILDCARD_STEP
Modifier | Constructor and Description |
---|---|
|
SchemaField() |
|
SchemaField(String fieldName)
Construct a new String SchemaField.
|
|
SchemaField(String fieldName,
SchemaField.Type fieldType)
Construct a new typed SchemaField.
|
protected |
SchemaField(String name,
SchemaField.Type type,
boolean internal)
Construct a new SchemaField.
|
Modifier and Type | Method and Description |
---|---|
void |
addIncludeField(String... fName)
Add include field(s).
|
void |
addProperty(String propName,
String propValue)
Adds a property to the field.
|
static void |
checkFieldName(String name) |
SchemaField |
clone() |
boolean |
containsProperty(String property)
Determine if the field has a given property.
|
boolean |
equals(Object other) |
String |
getDefaultValue()
Gets the default value for this SchemaField.
|
String |
getDisplayName()
Gets the display name for this SchemaField.
|
int |
getIncludedFieldCount()
Get the number of include fields.
|
SchemaField.LowerCaseMode |
getLowerCaseMode()
Get the lower case mode of this field.
|
int |
getMaxTokens() |
String |
getName()
Gets this SchemaField's name.
|
Map<String,String> |
getProperties()
Properties configured for this field.
|
String |
getProperty(String property)
Get a field property by name.
|
boolean |
getProperty(String property,
boolean defaultVal)
Get a field property by name with a default value.
|
double |
getProperty(String property,
double pdefaultValue)
Get a field property by name with a default value.
|
float |
getProperty(String property,
float pdefaultValue)
Get a field property by name with a default value.
|
int |
getProperty(String property,
int pdefaultValue)
Get a field property by name with a default value.
|
long |
getProperty(String property,
long pdefaultValue)
Get a field property by name with a default value.
|
String |
getProperty(String property,
String defaultVal)
Get a field property by name with a default value.
|
static SchemaField.Type |
getSchemaFieldType(Object o)
Gets the data type for a given value
|
SchemaField.TokenizeMode |
getTokenizeMode()
Get the tokenize mode of this field.
|
String |
getTokenizerName()
Get the name of the tokenizer for this
SchemaField . |
SchemaField.Type |
getType()
Gets the Type of this SchemaField.
|
int |
hashCode() |
boolean |
isDynamic()
Gets if this SchemaField is dynamic.
|
boolean |
isFacet()
Gets if this SchemaField should be facetable.
|
boolean |
isHighlight()
Gets if highlighting is enabled for this field.
|
boolean |
isIndexed()
Gets if this SchemaField should be indexed.
|
boolean |
isLowerCase()
true if this field should be indexed in lower case. |
boolean |
isMultiValue()
Get if this field can support multiple field values per document.
|
boolean |
isNaturalLanguage()
true if field can be used for "natural language" processing. |
boolean |
isRealTime()
Returns true if this SchemaField has real time attributes.
|
boolean |
isSameField(String fieldName)
Determines if the field names are the same or a variant based on dynamic field name rules.
|
boolean |
isSingleValue()
Get if this field is single valued.
|
boolean |
isSort()
Gets if this SchemaField should support sorting.
|
boolean |
isStored()
Gets if this SchemaField should be stored.
|
boolean |
isTokenized()
true if this field should be tokenized during ingestion. |
static boolean |
isValidDynamicField(String name)
Returns
true if name is a legal dynamic field name. |
static boolean |
isValidStaticField(String name)
Returns
true if name is a legal field name. |
Iterator<String> |
iterator()
Get the included field names.
|
void |
readExternal(ObjectInput in) |
void |
setDefaultValue(String defaultValue)
Sets the default value for this SchemaField.
|
void |
setDisplayName(String displayName)
Sets the display name for this SchemaField.
|
void |
setDynamic(boolean value)
Sets if this SchemaField is dynamic.
|
void |
setHighlight(boolean value)
Gets if highlighting is enabled for this field.
|
void |
setIndexed(boolean indexed)
Sets if this SchemaField should be indexed.
|
void |
setLowerCase(boolean value) |
void |
setLowerCaseMode(SchemaField.LowerCaseMode mode)
Set the lower case mode of this field.
|
void |
setMaxTokens(int maxTokens) |
void |
setMultiValue(boolean value)
Set if this field can support multiple field values per document.
|
void |
setName(String value)
Sets this SchemaField's name.
|
void |
setProperties(Map<String,String> features)
Sets the properties for this SchemaField.
|
void |
setRealTime(boolean value) |
void |
setSingleValue(boolean value)
Set if this field is single valued.
|
void |
setSort(boolean value)
Sets if this SchemaField should support sorting.
|
void |
setStored(boolean value)
Sets if this SchemaField should be stored.
|
void |
setTokenized(boolean value) |
void |
setTokenizeMode(SchemaField.TokenizeMode mode)
Set the tokenize mode of this field.
|
void |
setType(SchemaField.Type type)
Sets the Type of this SchemaField.
|
void |
writeExternal(ObjectOutput out) |
protected void |
writeExternal(ObjectOutput out,
boolean standalone) |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected String suffix
public SchemaField()
public SchemaField(String fieldName)
fieldName
- the field namepublic SchemaField(String fieldName, SchemaField.Type fieldType)
fieldName
- the field namefieldType
- the field typeprotected SchemaField(String name, SchemaField.Type type, boolean internal)
If internal
is true, field name will not be validated.
public static final void checkFieldName(String name)
public boolean isNaturalLanguage()
true
if field
can be used for "natural language" processing.public String getTokenizerName()
SchemaField
.public boolean isHighlight()
public void setHighlight(boolean value)
public boolean isSingleValue()
public void setSingleValue(boolean value)
WARNING: changing this setting to true requires reindexing to ensure no documents contain multiple values for a field.
public boolean isMultiValue()
public void setMultiValue(boolean value)
WARNING: changing this setting to false requires reindexing to ensure no documents contain multiple values for a field.
public boolean isRealTime()
public void setRealTime(boolean value)
public SchemaField.TokenizeMode getTokenizeMode()
public void setTokenizeMode(SchemaField.TokenizeMode mode)
public void setTokenized(boolean value)
public boolean isTokenized()
true
if this field should be tokenized during ingestion.public SchemaField.LowerCaseMode getLowerCaseMode()
public void setLowerCaseMode(SchemaField.LowerCaseMode mode)
public void setLowerCase(boolean value)
public boolean isLowerCase()
true
if this field should be indexed in lower case.public void addIncludeField(String... fName)
public int getIncludedFieldCount()
public String getName()
public void setName(String value)
public boolean isIndexed()
public void setIndexed(boolean indexed)
public boolean isFacet()
public boolean isStored()
public void setStored(boolean value)
public boolean isSort()
public void setSort(boolean value)
public SchemaField.Type getType()
public void setType(SchemaField.Type type)
public void setProperties(Map<String,String> features)
public void addProperty(String propName, String propValue)
propName
- the property namepropValue
- the property valuepublic String getDefaultValue()
public void setDefaultValue(String defaultValue)
public boolean containsProperty(String property)
public String getProperty(String property, String defaultVal)
public boolean getProperty(String property, boolean defaultVal)
public int getProperty(String property, int pdefaultValue)
public long getProperty(String property, long pdefaultValue)
public float getProperty(String property, float pdefaultValue)
public double getProperty(String property, double pdefaultValue)
public boolean isDynamic()
public void setDynamic(boolean value)
public boolean isSameField(String fieldName)
public String getDisplayName()
public void setDisplayName(String displayName)
public static SchemaField.Type getSchemaFieldType(Object o)
o
- the valuepublic static boolean isValidStaticField(String name)
true
if name
is a legal field name.public static boolean isValidDynamicField(String name)
true
if name
is a legal dynamic field name.public int getMaxTokens()
public void setMaxTokens(int maxTokens)
public SchemaField clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
protected void writeExternal(ObjectOutput out, boolean standalone) throws IOException
IOException
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.