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.
|
java.lang.String |
name()
Field name
|
StoredFieldVisitor.Status |
needsField(FieldInfo fieldInfo)
Hook before processing a field.
|
java.lang.Number |
numericValue()
Non-null if this field has a numeric value
|
java.io.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.
|
java.lang.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, waitgetCharSequenceValuepublic MergeVisitor(MergeState mergeState, int readerIndex)
public void binaryField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
StoredFieldVisitorbinaryField in class StoredFieldVisitorvalue - newly allocated byte array with the binary contents.java.io.IOExceptionpublic void stringField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
StoredFieldVisitorstringField in class StoredFieldVisitorjava.io.IOExceptionpublic void intField(FieldInfo fieldInfo, int value) throws java.io.IOException
StoredFieldVisitorintField in class StoredFieldVisitorjava.io.IOExceptionpublic void longField(FieldInfo fieldInfo, long value) throws java.io.IOException
StoredFieldVisitorlongField in class StoredFieldVisitorjava.io.IOExceptionpublic void floatField(FieldInfo fieldInfo, float value) throws java.io.IOException
StoredFieldVisitorfloatField in class StoredFieldVisitorjava.io.IOExceptionpublic void doubleField(FieldInfo fieldInfo, double value) throws java.io.IOException
StoredFieldVisitordoubleField in class StoredFieldVisitorjava.io.IOExceptionpublic StoredFieldVisitor.Status needsField(FieldInfo fieldInfo) throws java.io.IOException
StoredFieldVisitorStoredFieldVisitor.Status representing whether
they need that particular field or not, or to stop processing
entirely.needsField in class StoredFieldVisitorjava.io.IOExceptionpublic java.lang.String name()
IndexableFieldname in interface IndexableFieldpublic IndexableFieldType fieldType()
IndexableFieldIndexableFieldType describing the properties
of this field.fieldType in interface IndexableFieldpublic BytesRef binaryValue()
IndexableFieldbinaryValue in interface IndexableFieldpublic java.lang.String stringValue()
IndexableFieldstringValue in interface IndexableFieldpublic java.lang.Number numericValue()
IndexableFieldnumericValue in interface IndexableFieldpublic java.io.Reader readerValue()
IndexableFieldreaderValue in interface IndexableFieldpublic TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
IndexableFieldtokenStream in interface IndexableFieldanalyzer - 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–2025 The Apache Software Foundation. All rights reserved.