private static class SortingStoredFieldsConsumer.CopyVisitor extends StoredFieldVisitor implements IndexableField
StoredFieldsWriter
.StoredFieldVisitor.Status
Modifier and Type | Field and 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 and Description |
---|
CopyVisitor(StoredFieldsWriter writer) |
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
|
(package private) void |
reset(FieldInfo field) |
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.
|
(package private) void |
write() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCharSequenceValue
final StoredFieldsWriter writer
BytesRef binaryValue
java.lang.String stringValue
java.lang.Number numericValue
FieldInfo currentField
CopyVisitor(StoredFieldsWriter writer)
public void binaryField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
StoredFieldVisitor
binaryField
in class StoredFieldVisitor
value
- newly allocated byte array with the binary contents.java.io.IOException
public void stringField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
StoredFieldVisitor
stringField
in class StoredFieldVisitor
java.io.IOException
public void intField(FieldInfo fieldInfo, int value) throws java.io.IOException
StoredFieldVisitor
intField
in class StoredFieldVisitor
java.io.IOException
public void longField(FieldInfo fieldInfo, long value) throws java.io.IOException
StoredFieldVisitor
longField
in class StoredFieldVisitor
java.io.IOException
public void floatField(FieldInfo fieldInfo, float value) throws java.io.IOException
StoredFieldVisitor
floatField
in class StoredFieldVisitor
java.io.IOException
public void doubleField(FieldInfo fieldInfo, double value) throws java.io.IOException
StoredFieldVisitor
doubleField
in class StoredFieldVisitor
java.io.IOException
public StoredFieldVisitor.Status needsField(FieldInfo fieldInfo) throws java.io.IOException
StoredFieldVisitor
StoredFieldVisitor.Status
representing whether
they need that particular field or not, or to stop processing
entirely.needsField
in class StoredFieldVisitor
java.io.IOException
public java.lang.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 java.lang.String stringValue()
IndexableField
stringValue
in interface IndexableField
public java.lang.Number numericValue()
IndexableField
numericValue
in interface IndexableField
public java.io.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.void reset(FieldInfo field)
void write() throws java.io.IOException
java.io.IOException