Class FieldOptions
java.lang.Object
io.quarkus.redis.datasource.search.FieldOptions
Allows customizing the indexed field.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionblockSize
(int blockSize) For vector fields, specifies the block size (the amount of vectors to store in a contiguous array).For TAG attributes, keeps the original letter cases of the tags.dimension
(int dimension) For vector fields, specifies the dimension.distanceMetric
(DistanceMetric distanceMetric) For vector fields, specifies the distance metric.initialCap
(int initialCap) For vector fields, specifies the initial vector capacity in the index.noIndex()
Attributes can have theNOINDEX
option, which means they will not be indexed.noStem()
Text attributes can have theNOSTEM
argument which will disable stemming when indexing its values.Declaring a text attribute asPHONETIC
will perform phonetic matching on it in searches by default.separator
(char separator) For TAG attributes, indicates how the text contained in the attribute is to be split into individual tags.sortable()
Numeric, tag (not supported with JSON) or text attributes can have the optional SORTABLE argument.toArgs()
unf()
By default,SORTABLE
applies a normalization to the indexed value (characters set to lowercase, removal of diacritics).vectorAlgorithm
(VectorAlgorithm vectorAlgorithm) For vector fields, specifies the vector algorithm to use when searching k most similar vectors in an index.vectorType
(VectorType vectorType) For vector fields, specifies the vector type.weight
(double weight) For TEXT attributes, declares the importance of this attribute when calculating result accuracy.For TEXT and TAG attributes, keeps a suffix trie with all terms which match the suffix.
-
Constructor Details
-
FieldOptions
public FieldOptions()
-
-
Method Details
-
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
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
Text attributes can have theNOSTEM
argument which will disable stemming when indexing its values. This may be ideal for things like proper names.- Returns:
- the current
FieldOptions
-
noIndex
Attributes can have theNOINDEX
option, which means they will not be indexed. This is useful in conjunction withSORTABLE
, to create attributes whose update usingPARTIAL
will not cause full reindexing of the document. If an attribute hasNOINDEX
and doesn't haveSORTABLE
, it will just be ignored by the index.- Returns:
- the current
FieldOptions
-
phonetic
Declaring a text attribute asPHONETIC
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
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
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
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
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
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
For vector fields, specifies the vector type.- Parameters:
vectorType
- the vector type- Returns:
- the current
FieldOptions
-
dimension
For vector fields, specifies the dimension.- Parameters:
dimension
- the dimension- Returns:
- the current
FieldOptions
-
distanceMetric
For vector fields, specifies the distance metric.- Parameters:
distanceMetric
- the distance metric- Returns:
- the current
FieldOptions
-
initialCap
For vector fields, specifies the initial vector capacity in the index.- Parameters:
initialCap
- the initial capacity- Returns:
- the current
FieldOptions
-
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
-