Module org.apache.lucene.core
Package org.apache.lucene.codecs
Class StoredFieldsWriter.MergeVisitor
java.lang.Object
org.apache.lucene.index.StoredFieldVisitor
org.apache.lucene.codecs.StoredFieldsWriter.MergeVisitor
- All Implemented Interfaces:
IndexableField
- Enclosing class:
- StoredFieldsWriter
protected class StoredFieldsWriter.MergeVisitor
extends StoredFieldVisitor
implements IndexableField
A visitor that adds every field it sees.
Use like this:
MergeVisitor visitor = new MergeVisitor(mergeState, readerIndex);
for (...) {
startDocument();
storedFieldsReader.document(docID, visitor);
finishDocument();
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.StoredFieldVisitor
StoredFieldVisitor.Status -
Field Summary
FieldsModifier and TypeFieldDescription(package private) BytesRef(package private) FieldInfo(package private) Number(package private) FieldInfos(package private) String -
Constructor Summary
ConstructorsConstructorDescriptionMergeVisitor(MergeState mergeState, int readerIndex) Create new merge visitor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbinaryField(FieldInfo fieldInfo, byte[] value) Process a binary field.Non-null if this field has a binary valuevoiddoubleField(FieldInfo fieldInfo, double value) Process a double numeric field.IndexableFieldTypedescribing the properties of this field.voidfloatField(FieldInfo fieldInfo, float value) Process a float numeric field.voidProcess a int numeric field.voidProcess a long numeric field.name()Field nameneedsField(FieldInfo fieldInfo) Hook before processing a field.Non-null if this field has a numeric valueNon-null if this field has a Reader value(package private) voidvoidstringField(FieldInfo fieldInfo, String value) Process a string field.Non-null if this field has a string valuetokenStream(Analyzer analyzer, TokenStream reuse) Creates the TokenStream used for indexing this field.(package private) voidwrite()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.index.IndexableField
getCharSequenceValue
-
Field Details
-
binaryValue
BytesRef binaryValue -
stringValue
String stringValue -
numericValue
Number numericValue -
currentField
FieldInfo currentField -
remapper
FieldInfos remapper
-
-
Constructor Details
-
MergeVisitor
Create new merge visitor.
-
-
Method Details
-
binaryField
Description copied from class:StoredFieldVisitorProcess a binary field.- Overrides:
binaryFieldin classStoredFieldVisitorvalue- newly allocated byte array with the binary contents.- Throws:
IOException
-
stringField
Description copied from class:StoredFieldVisitorProcess a string field.- Overrides:
stringFieldin classStoredFieldVisitor- Throws:
IOException
-
intField
Description copied from class:StoredFieldVisitorProcess a int numeric field.- Overrides:
intFieldin classStoredFieldVisitor- Throws:
IOException
-
longField
Description copied from class:StoredFieldVisitorProcess a long numeric field.- Overrides:
longFieldin classStoredFieldVisitor- Throws:
IOException
-
floatField
Description copied from class:StoredFieldVisitorProcess a float numeric field.- Overrides:
floatFieldin classStoredFieldVisitor- Throws:
IOException
-
doubleField
Description copied from class:StoredFieldVisitorProcess a double numeric field.- Overrides:
doubleFieldin classStoredFieldVisitor- Throws:
IOException
-
needsField
Description copied from class:StoredFieldVisitorHook before processing a field. Before a field is processed, this method is invoked so that subclasses can return aStoredFieldVisitor.Statusrepresenting whether they need that particular field or not, or to stop processing entirely.- Specified by:
needsFieldin classStoredFieldVisitor- Throws:
IOException
-
name
Description copied from interface:IndexableFieldField name- Specified by:
namein interfaceIndexableField
-
fieldType
Description copied from interface:IndexableFieldIndexableFieldTypedescribing the properties of this field.- Specified by:
fieldTypein interfaceIndexableField
-
binaryValue
Description copied from interface:IndexableFieldNon-null if this field has a binary value- Specified by:
binaryValuein interfaceIndexableField
-
stringValue
Description copied from interface:IndexableFieldNon-null if this field has a string value- Specified by:
stringValuein interfaceIndexableField
-
numericValue
Description copied from interface:IndexableFieldNon-null if this field has a numeric value- Specified by:
numericValuein interfaceIndexableField
-
readerValue
Description copied from interface:IndexableFieldNon-null if this field has a Reader value- Specified by:
readerValuein interfaceIndexableField
-
tokenStream
Description copied from interface:IndexableFieldCreates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.- Specified by:
tokenStreamin interfaceIndexableField- Parameters:
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.- Returns:
- TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed
-
reset
-
write
- Throws:
IOException
-