public static class CreateArgs.Builder extends Object
CreateArgs.
As a final step the build() method needs to be executed to create the final CreateArgs instance.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
CreateArgs |
build() |
CreateArgs.Builder |
defaultLanguage(DocumentLanguage language)
Set the default language for the documents in the index.
|
CreateArgs.Builder |
defaultScore(double score)
Set the default score for the documents in the index.
|
CreateArgs.Builder |
filter(String filter)
Set a filter for the index.
|
CreateArgs.Builder |
languageField(String field)
Set the field that contains the language setting for the documents in the index.
|
CreateArgs.Builder |
maxTextFields()
Set the maximum number of text fields in the index.
|
CreateArgs.Builder |
noFields()
Set the no fields flag.
|
CreateArgs.Builder |
noFrequency()
Set the no frequency flag.
|
CreateArgs.Builder |
noHighlighting()
Set the no highlighting flag.
|
CreateArgs.Builder |
noOffsets()
Set the no offsets flag.
|
CreateArgs.Builder |
on(CreateArgs.TargetType targetType)
Set the
CreateArgs.TargetType type for the index. |
CreateArgs.Builder |
payloadField(String field)
Set the field that contains the payload setting for the documents in the index.
|
CreateArgs.Builder |
scoreField(String field)
Set the field that contains the score setting for the documents in the index.
|
CreateArgs.Builder |
skipInitialScan()
Set the skip initial scan flag.
|
CreateArgs.Builder |
stopWords(List<String> stopWords)
Set the index with a custom stopword list, to be ignored during indexing and search time.
|
CreateArgs.Builder |
temporary(long seconds)
Set the temporary index expiration time in seconds.
|
CreateArgs.Builder |
withPrefix(String prefix)
Add a prefix to the index.
|
CreateArgs.Builder |
withPrefixes(List<String> prefixes)
Add a list of prefixes to the index.
|
public CreateArgs.Builder on(CreateArgs.TargetType targetType)
CreateArgs.TargetType type for the index. Defaults to CreateArgs.TargetType.HASH.targetType - the target typeCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder withPrefix(String prefix)
The prefix is sent as written and is not passed through the key codec. With a codec that transforms keys, pass the
physical prefix of the stored keys, for example tenant:user: for a codec that prepends tenant:.
prefix - the prefixCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder withPrefixes(List<String> prefixes)
The prefixes are sent as written and is not passed through the key codec. With a codec that transforms keys, pass the
physical prefix of the stored keys, for example tenant:user: for a codec that prepends tenant:.
prefixes - a List of prefixesCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder filter(String filter)
filter - a filter expression with the full RediSearch aggregation expression languageCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder defaultLanguage(DocumentLanguage language)
language - the default languageCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder languageField(String field)
field - the language fieldCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder defaultScore(double score)
score - the default scoreCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder scoreField(String field)
field - the score fieldCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder payloadField(String field)
field - the payload fieldCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder maxTextFields()
CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder temporary(long seconds)
skipInitialScan() to avoid costly scanning.
Warning: When temporary indexes expire, they drop all the records associated with them. FT.DROPINDEX was introduced
with a default of not deleting docs and a DD flag that enforced deletion. However, for temporary indexes, documents
are deleted along with the index. Historically, RediSearch used an FT.ADD command, which made a connection between
the document and the index. Then, FT.DROP, also a hystoric command, deleted documents by default. In version 2.x,
RediSearch indexes hashes and JSONs, and the dependency between the index and documents no longer exists.seconds - the temporary index expiration time in secondsCreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder noOffsets()
noHighlighting() is
set to true.CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder noHighlighting()
CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder noFields()
CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder noFrequency()
CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder skipInitialScan()
CreateArgs.Builder for the purpose of method chainingpublic CreateArgs.Builder stopWords(List<String> stopWords)
stopWords - a list of stop wordsCreateArgs.Builder for the purpose of method chainingpublic CreateArgs build()
Copyright © 2026 lettuce.io. All rights reserved.