Class StringField

  extended by org.apache.lucene.document.Field
      extended by org.apache.lucene.document.StringField
All Implemented Interfaces:

public final class StringField
extends Field

A field that is indexed but not tokenized: the entire String value is indexed as a single token. For example this might be used for a 'country' field or an 'id' field, or any field that you intend to use for sorting or access through the field cache.

Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Index, Field.Store, Field.TermVector
Field Summary
static FieldType TYPE_NOT_STORED
          Indexed, not tokenized, omits norms, indexes DOCS_ONLY, not stored.
static FieldType TYPE_STORED
          Indexed, not tokenized, omits norms, indexes DOCS_ONLY, stored
Fields inherited from class org.apache.lucene.document.Field
boost, fieldsData, name, tokenStream, type
Constructor Summary
StringField(String name, String value, Field.Store stored)
          Creates a new StringField.
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static final FieldType TYPE_NOT_STORED
Indexed, not tokenized, omits norms, indexes DOCS_ONLY, not stored.


public static final FieldType TYPE_STORED
Indexed, not tokenized, omits norms, indexes DOCS_ONLY, stored

Constructor Detail


public StringField(String name,
                   String value,
                   Field.Store stored)
Creates a new StringField.

name - field name
value - String value
stored - Store.YES if the content should also be stored
IllegalArgumentException - if the field name or value is null.

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