Class FieldType

    • Constructor Detail

      • FieldType

        public FieldType​(FieldType ref)
        Create a new mutable FieldType with all of the properties from ref
      • FieldType

        public FieldType()
        Create a new FieldType with default properties.
    • Method Detail

      • freeze

        public void freeze()
        Prevents future changes. Note, it is recommended that this is called once the FieldTypes's properties have been set, to prevent unintentional state changes.
      • setIndexed

        public void setIndexed​(boolean value)
        Set to true to index (invert) this field.
        Parameters:
        value - true if this field should be indexed.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        indexed()
      • setStored

        public void setStored​(boolean value)
        Set to true to store this field.
        Parameters:
        value - true if this field should be stored.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        stored()
      • setTokenized

        public void setTokenized​(boolean value)
        Set to true to tokenize this field's contents via the configured Analyzer.
        Parameters:
        value - true if this field should be tokenized.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        tokenized()
      • setStoreTermVectors

        public void setStoreTermVectors​(boolean value)
        Set to true if this field's indexed form should be also stored into term vectors.
        Parameters:
        value - true if this field should store term vectors.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        storeTermVectors()
      • setStoreTermVectorOffsets

        public void setStoreTermVectorOffsets​(boolean value)
        Set to true to also store token character offsets into the term vector for this field.
        Parameters:
        value - true if this field should store term vector offsets.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        storeTermVectorOffsets()
      • setStoreTermVectorPositions

        public void setStoreTermVectorPositions​(boolean value)
        Set to true to also store token positions into the term vector for this field.
        Parameters:
        value - true if this field should store term vector positions.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        storeTermVectorPositions()
      • setStoreTermVectorPayloads

        public void setStoreTermVectorPayloads​(boolean value)
        Set to true to also store token payloads into the term vector for this field.
        Parameters:
        value - true if this field should store term vector payloads.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        storeTermVectorPayloads()
      • omitNorms

        public boolean omitNorms()
        True if normalization values should be omitted for the field.

        This saves memory, but at the expense of scoring quality (length normalization will be disabled), and if you omit norms, you cannot use index-time boosts.

        The default is false.

        Specified by:
        omitNorms in interface IndexableFieldType
        See Also:
        setOmitNorms(boolean)
      • setOmitNorms

        public void setOmitNorms​(boolean value)
        Set to true to omit normalization values for the field.
        Parameters:
        value - true if this field should omit norms.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        omitNorms()
      • setIndexOptions

        public void setIndexOptions​(FieldInfo.IndexOptions value)
        Sets the indexing options for the field:
        Parameters:
        value - indexing options
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        indexOptions()
      • setNumericType

        public void setNumericType​(FieldType.NumericType type)
        Specifies the field's numeric type.
        Parameters:
        type - numeric type, or null if the field has no numeric type.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        numericType()
      • setNumericPrecisionStep

        public void setNumericPrecisionStep​(int precisionStep)
        Sets the numeric precision step for the field.
        Parameters:
        precisionStep - numeric precision step for the field
        Throws:
        java.lang.IllegalArgumentException - if precisionStep is less than 1.
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        numericPrecisionStep()
      • toString

        public final java.lang.String toString()
        Prints a Field for human consumption.
        Overrides:
        toString in class java.lang.Object
      • setDocValueType

        public void setDocValueType​(FieldInfo.DocValuesType type)
        Set's the field's DocValuesType
        Parameters:
        type - DocValues type, or null if no DocValues should be stored.
        Throws:
        java.lang.IllegalStateException - if this FieldType is frozen against future modifications.
        See Also:
        docValueType()