Class FieldOptions

java.lang.Object
io.quarkus.redis.datasource.search.FieldOptions

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

    • FieldOptions

      public FieldOptions()
  • Method Details

    • 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
    • vectorAlgorithm

      public FieldOptions vectorAlgorithm(VectorAlgorithm vectorAlgorithm)
      For vector fields, specifies the vector algorithm to use when searching k most similar vectors in an index.
      Parameters:
      vectorAlgorithm - the vector algorithm
      Returns:
      the current FieldOptions
    • vectorType

      public FieldOptions vectorType(VectorType vectorType)
      For vector fields, specifies the vector type.
      Parameters:
      vectorType - the vector type
      Returns:
      the current FieldOptions
    • dimension

      public FieldOptions dimension(int dimension)
      For vector fields, specifies the dimension.
      Parameters:
      dimension - the dimension
      Returns:
      the current FieldOptions
    • distanceMetric

      public FieldOptions distanceMetric(DistanceMetric distanceMetric)
      For vector fields, specifies the distance metric.
      Parameters:
      distanceMetric - the distance metric
      Returns:
      the current FieldOptions
    • initialCap

      public FieldOptions initialCap(int initialCap)
      For vector fields, specifies the initial vector capacity in the index.
      Parameters:
      initialCap - the initial capacity
      Returns:
      the current FieldOptions
    • blockSize

      public FieldOptions blockSize(int blockSize)
      For vector fields, specifies the block size (the amount of vectors to store in a contiguous array).
      Parameters:
      blockSize - the block size
      Returns:
      the current FieldOptions
    • toArgs

      public List<String> toArgs()