Class TextField

  • All Implemented Interfaces:

    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.
    • Field Detail


        public static final FieldType TYPE_NOT_STORED
        Indexed, tokenized, not stored.

        public static final FieldType TYPE_STORED
        Indexed, tokenized, stored.
    • Constructor Detail

      • TextField

        public TextField​(String name,
                         String value,
                         Field.Store store)
        Creates a new TextField with String value.
        name - field name
        value - string value
        store - Store.YES if the content should also be stored
        IllegalArgumentException - if the field name or value is null.
    • Method Detail

      • setStringValue

        public void setStringValue​(String value)
        Description copied from class: Field
        Expert: change the value of this field. This can be used during indexing to re-use a single Field instance to improve indexing speed by avoiding GC cost of new'ing and reclaiming Field instances. Typically a single Document instance is re-used as well. This helps most on small documents.

        Each Field instance should only be used once within a single Document instance. See ImproveIndexingSpeed for details.

        setStringValue in class Field