protected class StoredFieldsWriter.MergeVisitor extends StoredFieldVisitor implements IndexableField
Use like this:
MergeVisitor visitor = new MergeVisitor(mergeState, readerIndex); for (...) { startDocument(); storedFieldsReader.visitDocument(docID, visitor); finishDocument(); }
StoredFieldVisitor.Status
Constructor and Description |
---|
MergeVisitor(MergeState mergeState,
int readerIndex)
Create new merge visitor.
|
Modifier and Type | Method and Description |
---|---|
void |
binaryField(FieldInfo fieldInfo,
byte[] value)
Process a binary field.
|
BytesRef |
binaryValue()
Non-null if this field has a binary value
|
void |
doubleField(FieldInfo fieldInfo,
double value)
Process a double numeric field.
|
IndexableFieldType |
fieldType()
IndexableFieldType describing the properties
of this field. |
void |
floatField(FieldInfo fieldInfo,
float value)
Process a float numeric field.
|
void |
intField(FieldInfo fieldInfo,
int value)
Process a int numeric field.
|
void |
longField(FieldInfo fieldInfo,
long value)
Process a long numeric field.
|
String |
name()
Field name
|
StoredFieldVisitor.Status |
needsField(FieldInfo fieldInfo)
Hook before processing a field.
|
Number |
numericValue()
Non-null if this field has a numeric value
|
Reader |
readerValue()
Non-null if this field has a Reader value
|
void |
stringField(FieldInfo fieldInfo,
byte[] value)
Process a string field; the provided byte[] value is a UTF-8 encoded string value.
|
String |
stringValue()
Non-null if this field has a string value
|
TokenStream |
tokenStream(Analyzer analyzer,
TokenStream reuse)
Creates the TokenStream used for indexing this field.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCharSequenceValue
public MergeVisitor(MergeState mergeState, int readerIndex)
public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException
StoredFieldVisitor
binaryField
in class StoredFieldVisitor
value
- newly allocated byte array with the binary contents.IOException
public void stringField(FieldInfo fieldInfo, byte[] value) throws IOException
StoredFieldVisitor
stringField
in class StoredFieldVisitor
IOException
public void intField(FieldInfo fieldInfo, int value) throws IOException
StoredFieldVisitor
intField
in class StoredFieldVisitor
IOException
public void longField(FieldInfo fieldInfo, long value) throws IOException
StoredFieldVisitor
longField
in class StoredFieldVisitor
IOException
public void floatField(FieldInfo fieldInfo, float value) throws IOException
StoredFieldVisitor
floatField
in class StoredFieldVisitor
IOException
public void doubleField(FieldInfo fieldInfo, double value) throws IOException
StoredFieldVisitor
doubleField
in class StoredFieldVisitor
IOException
public StoredFieldVisitor.Status needsField(FieldInfo fieldInfo) throws IOException
StoredFieldVisitor
StoredFieldVisitor.Status
representing whether
they need that particular field or not, or to stop processing
entirely.needsField
in class StoredFieldVisitor
IOException
public String name()
IndexableField
name
in interface IndexableField
public IndexableFieldType fieldType()
IndexableField
IndexableFieldType
describing the properties
of this field.fieldType
in interface IndexableField
public BytesRef binaryValue()
IndexableField
binaryValue
in interface IndexableField
public String stringValue()
IndexableField
stringValue
in interface IndexableField
public Number numericValue()
IndexableField
numericValue
in interface IndexableField
public Reader readerValue()
IndexableField
readerValue
in interface IndexableField
public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
IndexableField
tokenStream
in interface IndexableField
analyzer
- Analyzer that should be used to create the TokenStreams fromreuse
- TokenStream for a previous instance of this field name. This allows
custom field types (like StringField and NumericField) that do not use
the analyzer to still have good performance. Note: the passed-in type
may be inappropriate, for example if you mix up different types of Fields
for the same field name. So it's the responsibility of the implementation to
check.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.