Package org.apache.lucene.index
Class FieldInvertState
- java.lang.Object
-
- org.apache.lucene.index.FieldInvertState
-
public final class FieldInvertState extends java.lang.Object
This class tracks the number and position / offset parameters of terms being added to the index. The information collected in this class is also used to calculate the normalization factor for a field.
-
-
Constructor Summary
Constructors Constructor Description FieldInvertState(java.lang.String name)
Creates {code FieldInvertState} for the specified field name.FieldInvertState(java.lang.String name, int position, int length, int numOverlap, int offset, float boost)
Creates {code FieldInvertState} for the specified field name and values for all fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeSource
getAttributeSource()
Returns theAttributeSource
from theTokenStream
that provided the indexed tokens for this field.float
getBoost()
Get boost value.int
getLength()
Get total number of terms in this field.int
getMaxTermFrequency()
Get the maximum term-frequency encountered for any term in the field.java.lang.String
getName()
Return the field's nameint
getNumOverlap()
Get the number of terms withpositionIncrement == 0
.int
getOffset()
Get end offset of the last processed term.int
getPosition()
Get the last processed term position.int
getUniqueTermCount()
Return the number of unique terms encountered in this field.void
setBoost(float boost)
Set boost value.void
setLength(int length)
Set length value.void
setNumOverlap(int numOverlap)
Set number of terms withpositionIncrement == 0
.
-
-
-
Constructor Detail
-
FieldInvertState
public FieldInvertState(java.lang.String name)
Creates {code FieldInvertState} for the specified field name.
-
FieldInvertState
public FieldInvertState(java.lang.String name, int position, int length, int numOverlap, int offset, float boost)
Creates {code FieldInvertState} for the specified field name and values for all fields.
-
-
Method Detail
-
getPosition
public int getPosition()
Get the last processed term position.- Returns:
- the position
-
getLength
public int getLength()
Get total number of terms in this field.- Returns:
- the length
-
setLength
public void setLength(int length)
Set length value.
-
getNumOverlap
public int getNumOverlap()
Get the number of terms withpositionIncrement == 0
.- Returns:
- the numOverlap
-
setNumOverlap
public void setNumOverlap(int numOverlap)
Set number of terms withpositionIncrement == 0
.
-
getOffset
public int getOffset()
Get end offset of the last processed term.- Returns:
- the offset
-
getBoost
public float getBoost()
Get boost value. This is the cumulative product of document boost and field boost for all field instances sharing the same field name.- Returns:
- the boost
-
setBoost
public void setBoost(float boost)
Set boost value.
-
getMaxTermFrequency
public int getMaxTermFrequency()
Get the maximum term-frequency encountered for any term in the field. A field containing "the quick brown fox jumps over the lazy dog" would have a value of 2, because "the" appears twice.
-
getUniqueTermCount
public int getUniqueTermCount()
Return the number of unique terms encountered in this field.
-
getAttributeSource
public AttributeSource getAttributeSource()
Returns theAttributeSource
from theTokenStream
that provided the indexed tokens for this field.
-
getName
public java.lang.String getName()
Return the field's name
-
-