Class QueryArgs
java.lang.Object
io.quarkus.redis.datasource.search.QueryArgs
- All Implemented Interfaces:
RedisCommandExtraArguments
Represents the extra arguments of the
ft.search
command-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
dialect
(int version) Selects the dialect version under which to execute the query.Uses a custom query expander instead of the stemmer.Returns a textual description of how the scores were calculated.filter
(NumericFilter filter) Limits results to those having numeric values ranging between min and max, ifnumberFilter
is defined as a numeric attribute inFT.CREATE
.Filters the results to a given radius from lon and lat.highlight
(HighlightArgs args) formats occurrences of matched text.Filters the results to those appearing only in specific attributes of the document, like title or URL.final QueryArgs
Limits the result to a given set of keys specified in the list.inOrder()
Puts the query terms in the same order in the document as in the query, regardless of the offsets between them.Use a stemmer for the supplied language during search for query expansion.limit
(int offset, int count) Limits the results to the offset and number of results given.Returns the document ids and not the content.Defines a parameter with a byte array value.Defines a parameter with a double array value.Defines a parameter with a float array value.Defines a parameter with an int array value.Defines a parameter with a long array value.Defines one or more value parameters.returnAttribute
(String field) Limits the attributes returned from the document.returnAttribute
(String field, String alias) Limits the attributes returned from the document.Uses a custom scoring function you defineslop
(int slop) Allows a maximum ofslop
intervening number of unmatched offsets between phrase terms.sortByAscending
(String field) Orders the results by the value of this attribute.sortByDescending
(String field) Orders the results by the value of this attribute.summarize
(SummarizeArgs args) Returns only the sections of the attribute that contain the matched text.Overrides the timeout parameter of the module.verbatim()
Does not try to use stemming for query expansion but searches the query terms verbatim.Retrieves optional document payloads.Also returns the relative internal score of each document.returns the value of the sorting key, right after the id and score and/or payload, if requested.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.quarkus.redis.datasource.RedisCommandExtraArguments
toArgs
-
Field Details
-
nocontent
public boolean nocontent
-
-
Constructor Details
-
QueryArgs
public QueryArgs()
-
-
Method Details
-
nocontent
Returns the document ids and not the content. This is useful if RedisSearch is only an index on an external document collection.- Returns:
- the current
QueryArgs
-
verbatim
Does not try to use stemming for query expansion but searches the query terms verbatim.- Returns:
- the current
QueryArgs
-
withScores
Also returns the relative internal score of each document. This can be used to merge results from multiple instances.- Returns:
- the current
QueryArgs
-
withPayloads
Retrieves optional document payloads.- Returns:
- the current
QueryArgs
-
withSortKeys
returns the value of the sorting key, right after the id and score and/or payload, if requested. This is usually not needed, and exists for distributed search coordination purposes. This option is relevant only if used in conjunction withSORTBY
.- Returns:
- the current
QueryArgs
-
filter
Limits results to those having numeric values ranging between min and max, ifnumberFilter
is defined as a numeric attribute inFT.CREATE
. Min and max followZRANGE
syntax, and can be-inf
,+inf
, and use ( for exclusive ranges. Multiple numeric filters for different attributes are supported in one query.- Parameters:
filter
- the filter- Returns:
- the current
QueryArgs
-
geoFilter
Filters the results to a given radius from lon and lat. Radius is given as a number and units. SeeGEORADIUS
for more details.- Parameters:
filter
- the filter- Returns:
- the current
QueryArgs
-
inKeys
Limits the result to a given set of keys specified in the list. Non-existent keys are ignored, unless all the keys are non-existent.- Parameters:
keys
- the list of keys- Returns:
- the current
QueryArgs
-
inFields
Filters the results to those appearing only in specific attributes of the document, like title or URL.- Parameters:
fields
- the list of fields- Returns:
- the current
QueryArgs
-
returnAttribute
Limits the attributes returned from the document. If no return clauses are passed, it acts likeNOCONTENT
.field
is either an attribute name (for hashes and JSON) or a JSON Path expression (for JSON).alias
is the optional name used in the result. If not provided, thefield
is used in the result.- Parameters:
field
- the fieldalias
- the alias- Returns:
- the current
QueryArgs
-
returnAttribute
Limits the attributes returned from the document. If no return clauses are passed, it acts likeNOCONTENT
.field
is either an attribute name (for hashes and JSON) or a JSON Path expression (for JSON).alias
is the name used in the result. As it is not provided, thefield
is used in the result.- Parameters:
field
- the field- Returns:
- the current
QueryArgs
-
summarize
Returns only the sections of the attribute that contain the matched text.- Parameters:
args
- the summarize argument- Returns:
- the current
QueryArgs
-
highlight
formats occurrences of matched text.- Parameters:
args
- the summarize argument- Returns:
- the current
QueryArgs
-
slop
Allows a maximum ofslop
intervening number of unmatched offsets between phrase terms. In other words, the slop for exact phrases is 0.- Parameters:
slop
- the slop- Returns:
- the current
QueryArgs
-
inOrder
Puts the query terms in the same order in the document as in the query, regardless of the offsets between them. Typically used in conjunction withSLOP
.- Returns:
- the current
QueryArgs
-
language
Use a stemmer for the supplied language during search for query expansion. If querying documents in Chinese, set to chinese to properly tokenize the query terms. Defaults to English. If an unsupported language is sent, the command returns an error.- Parameters:
lang
- the language- Returns:
- the current
QueryArgs
-
expander
Uses a custom query expander instead of the stemmer.- Parameters:
expander
- the expander- Returns:
- the current
QueryArgs
-
scorer
Uses a custom scoring function you define- Parameters:
scorer
- the scorer- Returns:
- the current
QueryArgs
-
explainScore
Returns a textual description of how the scores were calculated. Using this options requires thesCORES
option.- Returns:
- the current
QueryArgs
-
sortByAscending
Orders the results by the value of this attribute. Use ascending order. This applies to both text and numeric attributes. Attributes needed forSORTBY
should be declared asSORTABLE
in the index, in order to be available with very low latency. Note that this adds memory overhead.- Parameters:
field
- the field- Returns:
- the current
QueryArgs
-
sortByDescending
Orders the results by the value of this attribute. Use descending order. This applies to both text and numeric attributes. Attributes needed forSORTBY
should be declared asSORTABLE
in the index, in order to be available with very low latency. Note that this adds memory overhead.- Parameters:
field
- the field- Returns:
- the current
QueryArgs
-
limit
Limits the results to the offset and number of results given. Note that the offset is zero-indexed. The default is 0 10, which returns 10 items starting from the first result. You can useLIMIT 0 0
to count the number of documents in the result set without actually returning them.- Parameters:
offset
- the offsetcount
- the count- Returns:
- the current
QueryArgs
-
timeout
Overrides the timeout parameter of the module.- Parameters:
timeout
- the timeout- Returns:
- the current
QueryArgs
-
param
Defines one or more value parameters. Each parameter has a name and a value. You can reference parameters in the query by a $, followed by the parameter name, for example, $user. Each such reference in the search query to a parameter name is substituted by the corresponding parameter value. For example, with parameter definition PARAMS 4 lon 29.69465 lat 34.95126, the expression @loc:[$lon $lat 10 km] is evaluated to @loc:[29.69465 34.95126 10 km]. You cannot reference parameters in the query string where concrete values are not allowed, such as in field names, for example, @loc.To use PARAMS, set DIALECT to 2.
- Parameters:
name
- the parameter namevalue
- the parameter value as String- Returns:
- the current
QueryArgs
-
param
Defines a parameter with a byte array value.- Parameters:
name
- the parameter namevalue
- the parameter value as byte array- Returns:
- the current
QueryArgs
-
param
Defines a parameter with a float array value.- Parameters:
name
- the parameter namevalue
- the parameter value as array of floats- Returns:
- the current
QueryArgs
-
param
Defines a parameter with a double array value.- Parameters:
name
- the parameter namevalue
- the parameter value as array of doubles- Returns:
- the current
QueryArgs
-
param
Defines a parameter with an int array value.- Parameters:
name
- the parameter namevalue
- the parameter value as array of ints- Returns:
- the current
QueryArgs
-
param
Defines a parameter with a long array value.- Parameters:
name
- the parameter namevalue
- the parameter value as array of longs- Returns:
- the current
QueryArgs
-
dialect
Selects the dialect version under which to execute the query. If not specified, the query will execute under the default dialect version set during module initial loading.- Parameters:
version
- the version- Returns:
- the current
QueryArgs
-
toArgs
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Parameters:
encoder
- an optional encoder to encode some of the values- Returns:
- the list of arguments.
-
containsScore
public boolean containsScore() -
containsPayload
public boolean containsPayload() -
containsSortKeys
public boolean containsSortKeys()
-