public interface NodeNumericTermAttribute
extends org.apache.lucene.util.Attribute
Attribute
for the
NumericTokenizer
for indexing numeric values that can be used by NodeNumericRangeQuery
.
This attribute provides a stream of tokens which iterates over the different precisions of a given numeric value.
The string representation of each precision is prefixed by:
Modifier and Type | Method and Description |
---|---|
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 valSize)
Initialise this attribute
|
void |
resetShift()
Reset the current shift value to 0
|
void |
setPrecisionStep(int precisionStep)
Set the precision step
|
org.apache.lucene.document.FieldType.NumericType getNumericType()
int getShift()
Undefined before first call to
#incrementShift(CharTermAttribute, NumericType)
int getValueSize()
float
, int
; 64 for
double
, long
)void setPrecisionStep(int precisionStep)
int getPrecisionStep()
void init(org.apache.lucene.document.FieldType.NumericType numericType, long value, int valSize)
void resetShift()
boolean incrementShift(org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt)
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.
Copyright © 2014. All rights reserved.