org.apache.lucene.index
Interface IndexableField

All Known Implementing Classes:
ByteDocValuesField, DerefBytesDocValuesField, DoubleDocValuesField, DoubleField, Field, FloatDocValuesField, FloatField, IntDocValuesField, IntField, LongDocValuesField, LongField, PackedLongDocValuesField, ShortDocValuesField, SortedBytesDocValuesField, StoredField, StraightBytesDocValuesField, StringField, TextField

public interface IndexableField

Represents a single field for indexing. IndexWriter consumes Iterable as a document.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Method Summary
 BytesRef binaryValue()
          Non-null if this field has a binary value
 float boost()
          Field boost (you must pre-multiply in any doc boost).
 IndexableFieldType fieldType()
          IndexableFieldType describing the properties of this field.
 String name()
          Field name
 Number numericValue()
          Non-null if this field has a numeric value
 Reader readerValue()
          Non-null if this field has a Reader value
 String stringValue()
          Non-null if this field has a string value
 TokenStream tokenStream(Analyzer analyzer)
          Creates the TokenStream used for indexing this field.
 

Method Detail

name

String name()
Field name


fieldType

IndexableFieldType fieldType()
IndexableFieldType describing the properties of this field.


boost

float boost()
Field boost (you must pre-multiply in any doc boost).


binaryValue

BytesRef binaryValue()
Non-null if this field has a binary value


stringValue

String stringValue()
Non-null if this field has a string value


readerValue

Reader readerValue()
Non-null if this field has a Reader value


numericValue

Number numericValue()
Non-null if this field has a numeric value


tokenStream

TokenStream tokenStream(Analyzer analyzer)
                        throws IOException
Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.

Parameters:
analyzer - Analyzer that should be used to create the TokenStreams from
Returns:
TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed
Throws:
IOException - Can be thrown while creating the TokenStream


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.