Skip to content

Commit 0893c22

Browse files
DEV: add RESP2/3 return information to the RQE commands (#1874)
* DEV: add RESP2/3 information to the RQE commands * 2nd commit * Cleanup * More cleanup * Update content/commands/ft.aliasadd.md Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> --------- Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
1 parent 78e0dae commit 0893c22

32 files changed

+504
-120
lines changed

content/commands/cf.exists.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ redis> CF.EXISTS cf item2
5959
(integer) 0
6060
{{< / highlight >}}
6161

62+
## Return information
63+
6264
{{< multitabs id="cf-exists-return-info"
6365
tab1="RESP2"
6466
tab2="RESP3" >}}

content/commands/cms.info.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ redis> CMS.INFO test
4747
6) (integer) 0
4848
```
4949

50+
## Return information
51+
5052
{{< multitabs id=“cms-info-return-info"
5153
tab1="RESP2"
5254
tab2="RESP3" >}}

content/commands/cms.query.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ redis> CMS.QUERY test foo bar
4646
2) (integer) 42
4747
```
4848

49+
## Return information
50+
4951
{{< multitabs id=“cms-merge-return-info"
5052
tab1="RESP2"
5153
tab2="RESP3" >}}

content/commands/ft._list.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,25 @@ In the future, a [`SCAN`]({{< relref "/commands/scan" >}}) type of command will
3838
contains a large number of indices.
3939
{{% /alert %}}
4040

41-
## Return
42-
43-
[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with index names.
44-
4541
## Examples
4642

4743
```sql
4844
FT._LIST
4945
1) "idx"
5046
2) "movies"
5147
3) "imdb"
52-
```
48+
```
49+
50+
## Return information
51+
52+
{{< multitabs id="ft-_list-return-info"
53+
tab1="RESP2"
54+
tab2="RESP3" >}}
55+
56+
[Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of index names as [simple strings]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}).
57+
58+
-tab-sep-
59+
60+
[Set]({{< relref "/develop/reference/protocol-spec#sets" >}}) of index names as [simple strings]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}).
61+
62+
{{< /multitabs >}}

content/commands/ft.aggregate.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,7 @@ You can use `@__score` in a pipeline as shown in the following example:
354354
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 or via [`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) command.
355355
</details>
356356

357-
## Return
358-
359-
FT.AGGREGATE returns an array reply where each row is an array reply and represents a single aggregate result.
360-
The [integer reply]({{< relref "develop/reference/protocol-spec#resp-integers" >}}) at position `1` does not represent a valid value.
361-
362-
### Return multiple values
357+
## Return multiple values
363358

364359
See [Return multiple values]({{< relref "commands/ft.search#return-multiple-values/" >}}) in [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})
365360
The `DIALECT` can be specified as a parameter in the FT.AGGREGATE command. If it is not specified, the `DEFAULT_DIALECT` is used, which can be set using [`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) or by passing it as an argument to the `redisearch` module when it is loaded.
@@ -489,13 +484,35 @@ Next, count GitHub events by user (actor), to produce the most active users.
489484

490485
</details>
491486

487+
## Return information
488+
489+
{{< multitabs id="ft-aggregate-return-info"
490+
tab1="RESP2"
491+
tab2="RESP3" >}}
492+
493+
One of the following:
494+
* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with the first element being the total number of results, followed by result rows as [arrays]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of field-value pairs.
495+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: incorrect number of arguments, non-existent index, invalid query syntax.
496+
497+
-tab-sep-
498+
499+
One of the following:
500+
* [Map]({{< relref "/develop/reference/protocol-spec#maps" >}}) with the following fields:
501+
- `attributes`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of attribute names.
502+
- `format`: [Simple string]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - result format.
503+
- `results`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [maps]({{< relref "/develop/reference/protocol-spec#maps" >}}) containing aggregated data.
504+
- `total_results`: [Integer]({{< relref "/develop/reference/protocol-spec#integers" >}}) - total number of results.
505+
- `warning`: [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of warning messages.
506+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: incorrect number of arguments, non-existent index, invalid query syntax.
507+
508+
{{< /multitabs >}}
509+
492510
## See also
493511

494-
[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})
512+
[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.SEARCH`]({{< relref "commands/ft.search/" >}})
495513

496514
## Related topics
497515

498516
- [Aggregations]({{< relref "/develop/ai/search-and-query/advanced-concepts/aggregations" >}})
499517
- [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}})
500518
- [RediSearch]({{< relref "/develop/ai/search-and-query" >}})
501-

content/commands/ft.aliasadd.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ alias.
5050

5151
FT.ALIASADD allows administrators to transparently redirect application queries to alternative indexes.
5252

53-
## Return
54-
55-
FT.ALIASADD returns a simple string reply `OK` if executed correctly, or an error reply otherwise.
56-
5753
## Examples
5854

5955
<details open>
@@ -74,10 +70,24 @@ Attempting to add the same alias returns a message that the alias already exists
7470
{{< / highlight >}}
7571
</details>
7672

77-
## See also
73+
## Return information
74+
75+
{{< multitabs id="ft-aliasadd-return-info"
76+
tab1="RESP2"
77+
tab2="RESP3" >}}
7878

79-
[`FT.ALIASDEL`]({{< relref "commands/ft.aliasdel/" >}}) | [`FT.ALIASUPDATE`]({{< relref "commands/ft.aliasupdate/" >}})
79+
One of the following:
80+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
81+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: alias already exists, index does not exist.
8082

81-
## Related topics
83+
-tab-sep-
84+
85+
One of the following:
86+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
87+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: alias already exists, index does not exist.
88+
89+
{{< /multitabs >}}
90+
91+
## See also
8292

83-
[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})
93+
[`FT.ALIASDEL`]({{< relref "commands/ft.aliasdel/" >}}) | [`FT.ALIASUPDATE`]({{< relref "commands/ft.aliasupdate/" >}})

content/commands/ft.aliasdel.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ Remove an alias from an index
4343
is index alias to be removed.
4444
</details>
4545

46-
## Return
47-
48-
FT.ALIASDEL returns a simple string reply `OK` if executed correctly, or an error reply otherwise.
49-
5046
## Examples
5147

5248
<details open>
@@ -60,10 +56,24 @@ OK
6056
{{< / highlight >}}
6157
</details>
6258

63-
## See also
59+
## Return information
60+
61+
{{< multitabs id="ft-aliasdel-return-info"
62+
tab1="RESP2"
63+
tab2="RESP3" >}}
6464

65-
[`FT.ALIASADD`]({{< relref "commands/ft.aliasadd/" >}}) | [`FT.ALIASUPDATE`]({{< relref "commands/ft.aliasupdate/" >}})
65+
One of the following:
66+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
67+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: alias does not exist.
6668

67-
## Related topics
69+
-tab-sep-
70+
71+
One of the following:
72+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
73+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: alias does not exist.
74+
75+
{{< /multitabs >}}
76+
77+
## See also
6878

69-
[RediSearch]({{< relref "/develop/ai/search-and-query/" >}})
79+
[`FT.ALIASADD`]({{< relref "commands/ft.aliasadd/" >}}) | [`FT.ALIASUPDATE`]({{< relref "commands/ft.aliasupdate/" >}})

content/commands/ft.aliasupdate.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ index, FT.ALIASUPDATE removes the alias association with the previous index.
4646
is alias to be added to an index.
4747
</details>
4848

49-
## Return
50-
51-
FT.ALIASUPDATE returns a simple string reply `OK` if executed correctly, or an error reply otherwise.
52-
5349
## Examples
5450

5551
<details open>
@@ -62,6 +58,24 @@ Update the alias of an index.
6258
OK
6359
{{< / highlight >}}
6460

61+
## Return information
62+
63+
{{< multitabs id="ft-aliasupdate-return-info"
64+
tab1="RESP2"
65+
tab2="RESP3" >}}
66+
67+
One of the following:
68+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
69+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: index does not exist.
70+
71+
-tab-sep-
72+
73+
One of the following:
74+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
75+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: index does not exist.
76+
77+
{{< /multitabs >}}
78+
6579
## See also
6680

6781
[`FT.ALIASADD`]({{< relref "commands/ft.aliasadd/" >}}) | [`FT.ALIASDEL`]({{< relref "commands/ft.aliasdel/" >}})

content/commands/ft.alter.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ contain more than 32 attributes, create it with the `MAXTEXTFIELDS` option.
8181
</note>
8282
</details>
8383

84-
## Return
85-
86-
FT.ALTER returns a simple string reply `OK` if executed correctly, or an error reply otherwise.
87-
8884
## Examples
8985

9086
<details open>
@@ -96,6 +92,24 @@ OK
9692
{{< / highlight >}}
9793
</details>
9894

95+
## Return information
96+
97+
{{< multitabs id="ft-alter-return-info"
98+
tab1="RESP2"
99+
tab2="RESP3" >}}
100+
101+
One of the following:
102+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
103+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index, invalid schema syntax.
104+
105+
-tab-sep-
106+
107+
One of the following:
108+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if executed correctly.
109+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: no such index, invalid schema syntax.
110+
111+
{{< /multitabs >}}
112+
99113
## See also
100114

101115
[`FT.CREATE`]({{< relref "commands/ft.create/" >}})

content/commands/ft.config-get.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ Retrieve configuration options
4848
is name of the configuration option, or '*' for all.
4949
</details>
5050

51-
## Return
52-
53-
FT.CONFIG GET returns an array reply of the configuration name and value.
54-
5551
## Examples
5652

5753
<details open>
@@ -140,9 +136,23 @@ FT.CONFIG GET returns an array reply of the configuration name and value.
140136
{{< / highlight >}}
141137
</details>
142138

139+
## Return information
140+
141+
{{< multitabs id="ft-config-get-return-info"
142+
tab1="RESP2"
143+
tab2="RESP3" >}}
144+
145+
[Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [arrays]({{< relref "/develop/reference/protocol-spec#arrays" >}}), where each sub-array contains a configuration option name and its value.
146+
147+
-tab-sep-
148+
149+
[Map]({{< relref "/develop/reference/protocol-spec#maps" >}}) where keys are configuration option names and values are their corresponding values.
150+
151+
{{< /multitabs >}}
152+
143153
## See also
144154

145-
[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.CONFIG HELP`]({{< relref "commands/ft.config-help/" >}})
155+
[`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.CONFIG HELP`]({{< relref "commands/ft.config-help/" >}})
146156

147157
## Related topics
148158

0 commit comments

Comments
 (0)