public class FieldType extends Object implements IndexableFieldType
Modifier and Type | Class and Description |
---|---|
static class |
FieldType.LegacyNumericType
Deprecated.
Please switch to
PointValues instead |
Constructor and Description |
---|
FieldType()
Create a new FieldType with default properties.
|
FieldType(FieldType ref)
Create a new mutable FieldType with all of the properties from
ref |
Modifier and Type | Method and Description |
---|---|
protected void |
checkIfFrozen()
Throws an exception if this FieldType is frozen.
|
DocValuesType |
docValuesType()
DocValues
DocValuesType : how the field's value will be indexed
into docValues. |
boolean |
equals(Object obj) |
void |
freeze()
Prevents future changes.
|
int |
hashCode() |
IndexOptions |
indexOptions()
IndexOptions , describing what should be
recorded into the inverted index |
int |
numericPrecisionStep()
Deprecated.
Please switch to
PointValues instead |
FieldType.LegacyNumericType |
numericType()
Deprecated.
Please switch to
PointValues instead |
boolean |
omitNorms()
True if normalization values should be omitted for the field.
|
int |
pointDimensionCount()
If this is positive, the field is indexed as a point.
|
int |
pointNumBytes()
The number of bytes in each dimension's values.
|
void |
setDimensions(int dimensionCount,
int dimensionNumBytes)
Enables points indexing.
|
void |
setDocValuesType(DocValuesType type)
Sets the field's DocValuesType
|
void |
setIndexOptions(IndexOptions value)
Sets the indexing options for the field:
|
void |
setNumericPrecisionStep(int precisionStep)
Deprecated.
Please switch to
PointValues instead |
void |
setNumericType(FieldType.LegacyNumericType type)
Deprecated.
Please switch to
PointValues instead |
void |
setOmitNorms(boolean value)
Set to
true to omit normalization values for the field. |
void |
setStored(boolean value)
Set to
true to store this field. |
void |
setStoreTermVectorOffsets(boolean value)
Set to
true to also store token character offsets into the term
vector for this field. |
void |
setStoreTermVectorPayloads(boolean value)
Set to
true to also store token payloads into the term
vector for this field. |
void |
setStoreTermVectorPositions(boolean value)
Set to
true to also store token positions into the term
vector for this field. |
void |
setStoreTermVectors(boolean value)
Set to
true if this field's indexed form should be also stored
into term vectors. |
void |
setTokenized(boolean value)
Set to
true to tokenize this field's contents via the
configured Analyzer . |
boolean |
stored()
True if the field's value should be stored
|
boolean |
storeTermVectorOffsets()
True if this field's token character offsets should also
be stored into term vectors.
|
boolean |
storeTermVectorPayloads()
True if this field's token payloads should also be stored
into the term vectors.
|
boolean |
storeTermVectorPositions()
True if this field's token positions should also be stored
into the term vectors.
|
boolean |
storeTermVectors()
True if this field's indexed form should be also stored
into term vectors.
|
boolean |
tokenized()
True if this field's value should be analyzed by the
Analyzer . |
String |
toString()
Prints a Field for human consumption.
|
public FieldType(FieldType ref)
ref
public FieldType()
protected void checkIfFrozen()
public void freeze()
public boolean stored()
The default is false
.
stored
in interface IndexableFieldType
setStored(boolean)
public void setStored(boolean value)
true
to store this field.value
- true if this field should be stored.IllegalStateException
- if this FieldType is frozen against
future modifications.stored()
public boolean tokenized()
Analyzer
.
This has no effect if IndexableFieldType.indexOptions()
returns
IndexOptions.NONE.
The default is true
.
tokenized
in interface IndexableFieldType
setTokenized(boolean)
public void setTokenized(boolean value)
true
to tokenize this field's contents via the
configured Analyzer
.value
- true if this field should be tokenized.IllegalStateException
- if this FieldType is frozen against
future modifications.tokenized()
public boolean storeTermVectors()
This builds a miniature inverted-index for this field which
can be accessed in a document-oriented way from
IndexReader.getTermVector(int,String)
.
This option is illegal if IndexableFieldType.indexOptions()
returns
IndexOptions.NONE.
The default is false
.
storeTermVectors
in interface IndexableFieldType
setStoreTermVectors(boolean)
public void setStoreTermVectors(boolean value)
true
if this field's indexed form should be also stored
into term vectors.value
- true if this field should store term vectors.IllegalStateException
- if this FieldType is frozen against
future modifications.storeTermVectors()
public boolean storeTermVectorOffsets()
This option is illegal if term vectors are not enabled for the field
(IndexableFieldType.storeTermVectors()
is false)
The default is false
.
storeTermVectorOffsets
in interface IndexableFieldType
setStoreTermVectorOffsets(boolean)
public void setStoreTermVectorOffsets(boolean value)
true
to also store token character offsets into the term
vector for this field.value
- true if this field should store term vector offsets.IllegalStateException
- if this FieldType is frozen against
future modifications.storeTermVectorOffsets()
public boolean storeTermVectorPositions()
This option is illegal if term vectors are not enabled for the field
(IndexableFieldType.storeTermVectors()
is false).
The default is false
.
storeTermVectorPositions
in interface IndexableFieldType
setStoreTermVectorPositions(boolean)
public void setStoreTermVectorPositions(boolean value)
true
to also store token positions into the term
vector for this field.value
- true if this field should store term vector positions.IllegalStateException
- if this FieldType is frozen against
future modifications.storeTermVectorPositions()
public boolean storeTermVectorPayloads()
This option is illegal if term vector positions are not enabled
for the field (IndexableFieldType.storeTermVectors()
is false).
The default is false
.
storeTermVectorPayloads
in interface IndexableFieldType
setStoreTermVectorPayloads(boolean)
public void setStoreTermVectorPayloads(boolean value)
true
to also store token payloads into the term
vector for this field.value
- true if this field should store term vector payloads.IllegalStateException
- if this FieldType is frozen against
future modifications.storeTermVectorPayloads()
public boolean omitNorms()
This saves memory, but at the expense of scoring quality (length normalization will be disabled), and if you omit norms, you cannot use index-time boosts.
The default is false
.
omitNorms
in interface IndexableFieldType
setOmitNorms(boolean)
public void setOmitNorms(boolean value)
true
to omit normalization values for the field.value
- true if this field should omit norms.IllegalStateException
- if this FieldType is frozen against
future modifications.omitNorms()
public IndexOptions indexOptions()
IndexOptions
, describing what should be
recorded into the inverted index
The default is IndexOptions.DOCS_AND_FREQS_AND_POSITIONS
.
indexOptions
in interface IndexableFieldType
setIndexOptions(IndexOptions)
public void setIndexOptions(IndexOptions value)
value
- indexing optionsIllegalStateException
- if this FieldType is frozen against
future modifications.indexOptions()
@Deprecated public void setNumericType(FieldType.LegacyNumericType type)
PointValues
insteadtype
- numeric type, or null if the field has no numeric type.IllegalStateException
- if this FieldType is frozen against
future modifications.numericType()
@Deprecated public FieldType.LegacyNumericType numericType()
PointValues
insteadLegacyNumericRangeQuery
can be used at
search time.
The default is null
(no numeric type)
@Deprecated public void setNumericPrecisionStep(int precisionStep)
PointValues
insteadprecisionStep
- numeric precision step for the fieldIllegalArgumentException
- if precisionStep is less than 1.IllegalStateException
- if this FieldType is frozen against
future modifications.numericPrecisionStep()
@Deprecated public int numericPrecisionStep()
PointValues
instead
This has no effect if numericType()
returns null.
The default is LegacyNumericUtils.PRECISION_STEP_DEFAULT
setNumericPrecisionStep(int)
public void setDimensions(int dimensionCount, int dimensionNumBytes)
public int pointDimensionCount()
IndexableFieldType
pointDimensionCount
in interface IndexableFieldType
public int pointNumBytes()
IndexableFieldType
pointNumBytes
in interface IndexableFieldType
public final String toString()
public DocValuesType docValuesType()
DocValuesType
: how the field's value will be indexed
into docValues.
The default is null
(no docValues)
docValuesType
in interface IndexableFieldType
setDocValuesType(DocValuesType)
public void setDocValuesType(DocValuesType type)
type
- DocValues type, or null if no DocValues should be stored.IllegalStateException
- if this FieldType is frozen against
future modifications.docValuesType()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.