Class AggregateArgs
- All Implemented Interfaces:
RedisCommandExtraArguments
ft.aggregate
command.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLoads all the document attributes from the source documents.apply
(AggregateArgs.Apply apply) Applies a 1-to-1 transformation on one or more properties and either stores the result as a new property down the pipeline or replaces any property using this transformation.cursorCount
(int count) When using a cursor, configure the number of result.cursorMaxIdleTime
(Duration maxIdleDuration) When using a cursor, configure the max idle duration.dialect
(int version) Selects the dialect version under which to execute the query.Adds the given attribute to the list of attribute loaded from the document source.Adds the given attribute to the list of attribute loaded from the document source.Filters the results using predicate expressions relating to values in each result.groupBy
(AggregateArgs.GroupBy groupBy) Groups the results in the pipeline based on one or more properties.boolean
limit
(int offset, int count) Limits the number of results to return just num results starting at index offset (zero-based).Defines one or more value parameters.sortBy
(AggregateArgs.SortBy sortBy) Sorts the pipeline up until the point ofSORTBY
, using the given property and the ascending order.Overrides the timeout parameter of the module.toArgs()
verbatim()
If set, does not try to use stemming for query expansion but searches the query terms verbatim.Scan part of the results with a quicker alternative thanLIMIT
.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
-
Constructor Details
-
AggregateArgs
public AggregateArgs()
-
-
Method Details
-
verbatim
If set, does not try to use stemming for query expansion but searches the query terms verbatim.- Returns:
- the current
AggregateArgs
-
allFields
Loads all the document attributes from the source documents.- Returns:
- the current
AggregateArgs
-
field
Adds the given attribute to the list of attribute loaded from the document source. You can pass the list of identifier, being either an attribute name for hashes and JSON or a JSON Path expression for JSON. The alias is the optional name used in the result. If it is not provided, the identifier is used. This should be avoided.Attributes needed for aggregations should be stored as
SORTABLE
, where they are available to the aggregation pipeline with very low latency. LOAD hurts the performance of aggregate queries considerably because every processed record needs to execute the equivalent ofHMGET
against a Redis key, which when executed over millions of keys, amounts to high processing times.- Parameters:
field
- the fieldalias
- the alias (optional but recommended)- Returns:
- the current
AggregateArgs
-
field
Adds the given attribute to the list of attribute loaded from the document source. You can pass the list of identifier, being either an attribute name for hashes and JSON or a JSON Path expression for JSON.Attributes needed for aggregations should be stored as
SORTABLE
, where they are available to the aggregation pipeline with very low latency. LOAD hurts the performance of aggregate queries considerably because every processed record needs to execute the equivalent ofHMGET
against a Redis key, which when executed over millions of keys, amounts to high processing times.- Parameters:
field
- the field- Returns:
- the current
AggregateArgs
-
timeout
Overrides the timeout parameter of the module.- Parameters:
timeout
- the timeout- Returns:
- the current
AggregateArgs
-
groupBy
Groups the results in the pipeline based on one or more properties. Each group should have at least one reducer, a function that handles the group entries, either counting them, or performing multiple aggregate operations.- Parameters:
groupBy
- the group by clause- Returns:
- the current
AggregateArgs
-
sortBy
Sorts the pipeline up until the point ofSORTBY
, using the given property and the ascending order.- Parameters:
sortBy
- the sort by clause- Returns:
- the current
AggregateArgs
-
apply
Applies a 1-to-1 transformation on one or more properties and either stores the result as a new property down the pipeline or replaces any property using this transformation.expression
is an expression that can be used to perform arithmetic operations on numeric properties, or functions that can be applied on properties depending on their types, or any combination thereof.For example, APPLY "sqrt(@foo)/log(@bar) + 5" AS baz evaluates this expression dynamically for each record in the pipeline and store the result as a new property called baz, which can be referenced by further APPLY/SORTBY/GROUPBY/REDUCE operations down the pipeline.
- Parameters:
apply
- the Apply clause- Returns:
- the current
AggregateArgs
-
limit
Limits the number of results to return just num results starting at index offset (zero-based). It is much more efficient to useSORTBY … MAX
if you are interested in just limiting the output of a sort operation.- Parameters:
offset
- the offsetcount
- the count- Returns:
- the current
AggregateArgs
-
filter
Filters the results using predicate expressions relating to values in each result. They are applied post query and relate to the current state of the pipeline.- Parameters:
filter
- the filter- Returns:
- the current
AggregateArgs
-
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- Returns:
- the current
AggregateArgs
-
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
AggregateArgs
-
withCursor
Scan part of the results with a quicker alternative thanLIMIT
.- Returns:
- the current
AggregateArgs
-
cursorCount
When using a cursor, configure the number of result.- Parameters:
count
- the number of result to fetch in one go.- Returns:
- the current
AggregateArgs
-
cursorMaxIdleTime
When using a cursor, configure the max idle duration.- Parameters:
maxIdleDuration
- the max idle duration of the cursor.- Returns:
- the current
AggregateArgs
-
toArgs
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Returns:
- the list of arguments.
-
hasCursor
public boolean hasCursor()
-