Package org.apache.lucene.document
Class TextField
- java.lang.Object
-
- org.apache.lucene.document.Field
-
- org.apache.lucene.document.TextField
-
- All Implemented Interfaces:
IndexableField
public final class TextField extends Field
A field that is indexed and tokenized, without term vectors. For example this would be used on a 'body' field, that contains the bulk of a document's text.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Index, Field.Store, Field.TermVector
-
-
Field Summary
Fields Modifier and Type Field Description static FieldType
TYPE_NOT_STORED
Indexed, tokenized, not stored.static FieldType
TYPE_STORED
Indexed, tokenized, stored.
-
Constructor Summary
Constructors Constructor Description TextField(java.lang.String name, java.io.Reader reader)
Creates a new un-stored TextField with Reader value.TextField(java.lang.String name, java.lang.String value, Field.Store store)
Creates a new TextField with String value.TextField(java.lang.String name, TokenStream stream)
Creates a new un-stored TextField with TokenStream value.
-
Method Summary
-
Methods inherited from class org.apache.lucene.document.Field
binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString, translateFieldType
-
-
-
-
Constructor Detail
-
TextField
public TextField(java.lang.String name, java.io.Reader reader)
Creates a new un-stored TextField with Reader value.- Parameters:
name
- field namereader
- reader value- Throws:
java.lang.IllegalArgumentException
- if the field name is nulljava.lang.NullPointerException
- if the reader is null
-
TextField
public TextField(java.lang.String name, java.lang.String value, Field.Store store)
Creates a new TextField with String value.- Parameters:
name
- field namevalue
- string valuestore
- Store.YES if the content should also be stored- Throws:
java.lang.IllegalArgumentException
- if the field name or value is null.
-
TextField
public TextField(java.lang.String name, TokenStream stream)
Creates a new un-stored TextField with TokenStream value.- Parameters:
name
- field namestream
- TokenStream value- Throws:
java.lang.IllegalArgumentException
- if the field name is null.java.lang.NullPointerException
- if the tokenStream is null
-
-