Package redis.clients.jedis.search
Class IndexOptions
java.lang.Object
redis.clients.jedis.search.IndexOptions
- All Implemented Interfaces:
IParams
IndexOptions encapsulates flags for index creation and should be given to the client on index
creation
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate IndexDefinitionprivate longprivate final intstatic final intIf set (default), we keep flags per index record telling us what fields the term appeared on, and allowing us to filter results by fieldstatic final intWith each document:term record, store how often the term appears within the document.static final intSet this to tell the index not to save term offset vectors. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParams(CommandArguments args) static IndexOptionsThe default indexing options - use term offsets and keep fields flagssetDefinition(IndexDefinition definition) Set the index to contain no stopwords, overriding the default listsetStopwords(String... stopwords) Set a custom stopword listsetTemporary(long expire) Temporary
-
Field Details
-
USE_TERM_OFFSETS
public static final int USE_TERM_OFFSETSSet this to tell the index not to save term offset vectors. This reduces memory consumption but does not allow performing exact matches, and reduces overall relevance of multi-term queries- See Also:
-
KEEP_FIELD_FLAGS
public static final int KEEP_FIELD_FLAGSIf set (default), we keep flags per index record telling us what fields the term appeared on, and allowing us to filter results by field- See Also:
-
KEEP_TERM_FREQUENCIES
public static final int KEEP_TERM_FREQUENCIESWith each document:term record, store how often the term appears within the document. This can be used for sorting documents by their relevance to the given term.- See Also:
-
DEFAULT_FLAGS
public static final int DEFAULT_FLAGS- See Also:
-
flags
private final int flags -
stopwords
-
expire
private long expire -
definition
-
-
Constructor Details
-
IndexOptions
public IndexOptions(int flags) Default constructor- Parameters:
flags- flag mask
-
-
Method Details
-
defaultOptions
The default indexing options - use term offsets and keep fields flags -
setStopwords
Set a custom stopword list- Parameters:
stopwords- the list of stopwords- Returns:
- the options object itself, for builder-style construction
-
setNoStopwords
Set the index to contain no stopwords, overriding the default list- Returns:
- the options object itself, for builder-style constructions
-
setTemporary
Temporary- Parameters:
expire-- Returns:
- IndexOptions
-
getDefinition
-
setDefinition
-
addParams
-