Package org.apache.lucene.index
Class SortingStoredFieldsConsumer.CopyVisitor
- java.lang.Object
-
- org.apache.lucene.index.StoredFieldVisitor
-
- org.apache.lucene.index.SortingStoredFieldsConsumer.CopyVisitor
-
- All Implemented Interfaces:
IndexableField
- Enclosing class:
- SortingStoredFieldsConsumer
private static class SortingStoredFieldsConsumer.CopyVisitor extends StoredFieldVisitor implements IndexableField
A visitor that copies every field it sees in the providedStoredFieldsWriter
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.StoredFieldVisitor
StoredFieldVisitor.Status
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BytesRef
binaryValue
(package private) FieldInfo
currentField
(package private) java.lang.Number
numericValue
(package private) java.lang.String
stringValue
(package private) StoredFieldsWriter
writer
-
Constructor Summary
Constructors Constructor Description CopyVisitor(StoredFieldsWriter writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
binaryField(FieldInfo fieldInfo, byte[] value)
Process a binary field.BytesRef
binaryValue()
Non-null if this field has a binary valuevoid
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 nameStoredFieldVisitor.Status
needsField(FieldInfo fieldInfo)
Hook before processing a field.java.lang.Number
numericValue()
Non-null if this field has a numeric valuejava.io.Reader
readerValue()
Non-null if this field has a Reader value(package private) void
reset(FieldInfo field)
void
stringField(FieldInfo fieldInfo, java.lang.String value)
Process a string field.java.lang.String
stringValue()
Non-null if this field has a string valueTokenStream
tokenStream(Analyzer analyzer, TokenStream reuse)
Creates the TokenStream used for indexing this field.(package private) void
write()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.index.IndexableField
getCharSequenceValue
-
-
-
-
Field Detail
-
writer
final StoredFieldsWriter writer
-
binaryValue
BytesRef binaryValue
-
stringValue
java.lang.String stringValue
-
numericValue
java.lang.Number numericValue
-
currentField
FieldInfo currentField
-
-
Constructor Detail
-
CopyVisitor
CopyVisitor(StoredFieldsWriter writer)
-
-
Method Detail
-
binaryField
public void binaryField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a binary field.- Overrides:
binaryField
in classStoredFieldVisitor
value
- newly allocated byte array with the binary contents.- Throws:
java.io.IOException
-
stringField
public void stringField(FieldInfo fieldInfo, java.lang.String value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a string field.- Overrides:
stringField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
intField
public void intField(FieldInfo fieldInfo, int value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a int numeric field.- Overrides:
intField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
longField
public void longField(FieldInfo fieldInfo, long value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a long numeric field.- Overrides:
longField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
floatField
public void floatField(FieldInfo fieldInfo, float value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a float numeric field.- Overrides:
floatField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
doubleField
public void doubleField(FieldInfo fieldInfo, double value) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Process a double numeric field.- Overrides:
doubleField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
needsField
public StoredFieldVisitor.Status needsField(FieldInfo fieldInfo) throws java.io.IOException
Description copied from class:StoredFieldVisitor
Hook before processing a field. Before a field is processed, this method is invoked so that subclasses can return aStoredFieldVisitor.Status
representing whether they need that particular field or not, or to stop processing entirely.- Specified by:
needsField
in classStoredFieldVisitor
- Throws:
java.io.IOException
-
name
public java.lang.String name()
Description copied from interface:IndexableField
Field name- Specified by:
name
in interfaceIndexableField
-
fieldType
public IndexableFieldType fieldType()
Description copied from interface:IndexableField
IndexableFieldType
describing the properties of this field.- Specified by:
fieldType
in interfaceIndexableField
-
binaryValue
public BytesRef binaryValue()
Description copied from interface:IndexableField
Non-null if this field has a binary value- Specified by:
binaryValue
in interfaceIndexableField
-
stringValue
public java.lang.String stringValue()
Description copied from interface:IndexableField
Non-null if this field has a string value- Specified by:
stringValue
in interfaceIndexableField
-
numericValue
public java.lang.Number numericValue()
Description copied from interface:IndexableField
Non-null if this field has a numeric value- Specified by:
numericValue
in interfaceIndexableField
-
readerValue
public java.io.Reader readerValue()
Description copied from interface:IndexableField
Non-null if this field has a Reader value- Specified by:
readerValue
in interfaceIndexableField
-
tokenStream
public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
Description copied from interface:IndexableField
Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.- Specified by:
tokenStream
in 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
void reset(FieldInfo field)
-
write
void write() throws java.io.IOException
- Throws:
java.io.IOException
-
-