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()
NodeNumericTermAttributegetNumericType in interface NodeNumericTermAttributepublic int getShift()
NodeNumericTermAttribute
Undefined before first call to
#incrementShift(CharTermAttribute, NumericType)
getShift in interface NodeNumericTermAttributepublic void resetShift()
NodeNumericTermAttributeresetShift in interface NodeNumericTermAttributepublic int getValueSize()
NodeNumericTermAttributefloat, int; 64 for
double, long)getValueSize in interface NodeNumericTermAttributepublic void setPrecisionStep(int precisionStep)
NodeNumericTermAttributesetPrecisionStep in interface NodeNumericTermAttributepublic int getPrecisionStep()
NodeNumericTermAttributegetPrecisionStep in interface NodeNumericTermAttributepublic void init(org.apache.lucene.document.FieldType.NumericType numericType,
long value,
int valueSize)
NodeNumericTermAttributeinit in interface NodeNumericTermAttributepublic 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 NodeNumericTermAttributepublic void clear()
clear in class org.apache.lucene.util.AttributeImplpublic void copyTo(org.apache.lucene.util.AttributeImpl target)
copyTo in class org.apache.lucene.util.AttributeImplCopyright © 2014. All rights reserved.