Class FieldOptions


  • public class FieldOptions
    extends Object
    Allows customizing the indexed field.
    • Constructor Detail

      • FieldOptions

        public FieldOptions()
    • Method Detail

      • sortable

        public FieldOptions sortable()
        Numeric, tag (not supported with JSON) or text attributes can have the optional SORTABLE argument. As the user sorts the results by the value of this attribute, the results will be available with very low latency. (this adds memory overhead so consider not to declare it on large text attributes).
        Returns:
        the current FieldOptions
      • unf

        public FieldOptions unf()
        By default, SORTABLE applies a normalization to the indexed value (characters set to lowercase, removal of diacritics). When using un-normalized form (UNF), you can disable the normalization and keep the original form of the value.
        Returns:
        the current FieldOptions
      • noStem

        public FieldOptions noStem()
        Text attributes can have the NOSTEM argument which will disable stemming when indexing its values. This may be ideal for things like proper names.
        Returns:
        the current FieldOptions
      • noIndex

        public FieldOptions noIndex()
        Attributes can have the NOINDEX option, which means they will not be indexed. This is useful in conjunction with SORTABLE, to create attributes whose update using PARTIAL will not cause full reindexing of the document. If an attribute has NOINDEX and doesn't have SORTABLE, it will just be ignored by the index.
        Returns:
        the current FieldOptions
      • phonetic

        public FieldOptions phonetic​(String phonetic)
        Declaring a text attribute as PHONETIC will perform phonetic matching on it in searches by default. The obligatory argument specifies the phonetic algorithm and language used.
        Parameters:
        phonetic - the phonetic algorithm
        Returns:
        the current FieldOptions
      • weight

        public FieldOptions weight​(double weight)
        For TEXT attributes, declares the importance of this attribute when calculating result accuracy. This is a multiplication factor, and defaults to 1 if not specified.
        Parameters:
        weight - the weight
        Returns:
        the current FieldOptions
      • separator

        public FieldOptions separator​(char separator)
        For TAG attributes, indicates how the text contained in the attribute is to be split into individual tags. The default is ,. The value must be a single character.
        Parameters:
        separator - the separator
        Returns:
        the current FieldOptions
      • caseSensitive

        public FieldOptions caseSensitive()
        For TAG attributes, keeps the original letter cases of the tags. If not specified, the characters are converted to lowercase.
        Returns:
        the current FieldOptions
      • withSuffixTrie

        public FieldOptions withSuffixTrie()
        For TEXT and TAG attributes, keeps a suffix trie with all terms which match the suffix. It is used to optimize contains (foo) and suffix (*foo) queries. Otherwise, a brute-force search on the trie is performed. If suffix trie exists for some fields, these queries will be disabled for other fields.
        Returns:
        the current FieldOptions