public class NodeNumericTermAttributeImpl extends org.apache.lucene.util.AttributeImpl implements NodeNumericTermAttribute
NodeNumericTermAttribute
.Constructor and Description |
---|
NodeNumericTermAttributeImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
copyTo(org.apache.lucene.util.AttributeImpl target) |
org.apache.lucene.document.FieldType.NumericType |
getNumericType()
Return the numeric type of the value
|
int |
getPrecisionStep()
Returns the precision step
|
int |
getShift()
Returns the current shift value
|
int |
getValueSize()
Returns the value size in bits (32 for
float , int ; 64 for
double , long ) |
boolean |
incrementShift(org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt)
Increment the shift and generate the next token.
|
void |
init(org.apache.lucene.document.FieldType.NumericType numericType,
long value,
int valueSize)
Initialise this attribute
|
void |
resetShift()
Reset the current shift value to 0
|
void |
setPrecisionStep(int precisionStep)
Set the precision step
|
public org.apache.lucene.document.FieldType.NumericType getNumericType()
NodeNumericTermAttribute
getNumericType
in interface NodeNumericTermAttribute
public int getShift()
NodeNumericTermAttribute
Undefined before first call to
#incrementShift(CharTermAttribute, NumericType)
getShift
in interface NodeNumericTermAttribute
public void resetShift()
NodeNumericTermAttribute
resetShift
in interface NodeNumericTermAttribute
public int getValueSize()
NodeNumericTermAttribute
float
, int
; 64 for
double
, long
)getValueSize
in interface NodeNumericTermAttribute
public void setPrecisionStep(int precisionStep)
NodeNumericTermAttribute
setPrecisionStep
in interface NodeNumericTermAttribute
public int getPrecisionStep()
NodeNumericTermAttribute
getPrecisionStep
in interface NodeNumericTermAttribute
public void init(org.apache.lucene.document.FieldType.NumericType numericType, long value, int valueSize)
NodeNumericTermAttribute
init
in interface NodeNumericTermAttribute
public boolean incrementShift(org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt)
NodeNumericTermAttribute
The original Lucene's NumericTokenStream.NumericTermAttribute
implements
TermToBytesRefAttribute
. There is a conflict problem with the
CharTermAttribute
used in higher-level SIREn's analyzers, which also
implements TermToBytesRefAttribute
.
The problem is that the AttributeSource
is not able to choose
between the two when requested an attribute implementing
TermToBytesRefAttribute
, e.g., in TermsHashPerField.
The current solution is to fill the BytesRef
attribute of the
CharTermAttribute
with the encoded numeric value.
incrementShift
in interface NodeNumericTermAttribute
public void clear()
clear
in class org.apache.lucene.util.AttributeImpl
public void copyTo(org.apache.lucene.util.AttributeImpl target)
copyTo
in class org.apache.lucene.util.AttributeImpl
Copyright © 2014. All rights reserved.