You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -92,9 +92,9 @@ Here is an explanation of the additional constructs:
92
92
93
93
The following query shows you how to group by the field `condition` and apply a reduction based on the previously derived `price_category`. The expression `@price<1000` causes a bicycle to have the price category `1` if its price is lower than 1000 USD. Otherwise, it has the price category `0`. The output is the number of affordable bicycles grouped by price category.
94
94
95
-
```
95
+
{{< clients-example query_agg agg2 >}}
96
96
FT.AGGREGATE idx:bicycle "*" LOAD 1 price APPLY "@price<1000" AS price_category GROUPBY 1 @condition REDUCE SUM 1 "@price_category" AS "num_affordable"
97
-
```
97
+
{{< /clients-example >}}
98
98
99
99
```
100
100
1) "3"
@@ -123,9 +123,9 @@ You can't use an aggregation function outside of a `GROUPBY` clause, but you can
123
123
124
124
Here is an example that adds a type attribute `bicycle` to each document before counting all documents with that type:
125
125
126
-
```
126
+
{{< clients-example query_agg agg3 >}}
127
127
FT.AGGREGATE idx:bicycle "*" APPLY "'bicycle'" AS type GROUPBY 1 @type REDUCE COUNT 0 AS num_total
128
-
```
128
+
{{< /clients-example >}}
129
129
130
130
The result is:
131
131
@@ -143,28 +143,28 @@ It's sometimes necessary to group your data without applying a mathematical aggr
143
143
144
144
The following example shows how to group all bicycles by `condition`:
0 commit comments