Class FieldOptions
- java.lang.Object
-
- io.quarkus.redis.datasource.search.FieldOptions
-
public class FieldOptions extends Object
Allows customizing the indexed field.
-
-
Constructor Summary
Constructors Constructor Description FieldOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldOptionscaseSensitive()For TAG attributes, keeps the original letter cases of the tags.FieldOptionsnoIndex()Attributes can have theNOINDEXoption, which means they will not be indexed.FieldOptionsnoStem()Text attributes can have theNOSTEMargument which will disable stemming when indexing its values.FieldOptionsphonetic(String phonetic)Declaring a text attribute asPHONETICwill perform phonetic matching on it in searches by default.FieldOptionsseparator(char separator)For TAG attributes, indicates how the text contained in the attribute is to be split into individual tags.FieldOptionssortable()Numeric, tag (not supported with JSON) or text attributes can have the optional SORTABLE argument.List<String>toArgs()FieldOptionsunf()By default,SORTABLEapplies a normalization to the indexed value (characters set to lowercase, removal of diacritics).FieldOptionsweight(double weight)For TEXT attributes, declares the importance of this attribute when calculating result accuracy.FieldOptionswithSuffixTrie()For TEXT and TAG attributes, keeps a suffix trie with all terms which match the suffix.
-
-
-
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,SORTABLEapplies 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 theNOSTEMargument 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 theNOINDEXoption, which means they will not be indexed. This is useful in conjunction withSORTABLE, to create attributes whose update usingPARTIALwill not cause full reindexing of the document. If an attribute hasNOINDEXand doesn't haveSORTABLE, it will just be ignored by the index.- Returns:
- the current
FieldOptions
-
phonetic
public FieldOptions phonetic(String phonetic)
Declaring a text attribute asPHONETICwill 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
-
-