Skip to content

Commit ddb3916

Browse files
DEV: add info about WITHOUTCOUNT parameter (#2496)
* DEV: add info about WITHOUTCOUNT parameter * Apply suggestions from code review Co-authored-by: mich-elle-luna <153109578+mich-elle-luna@users.noreply.github.com> --------- Co-authored-by: mich-elle-luna <153109578+mich-elle-luna@users.noreply.github.com>
1 parent a5267ab commit ddb3916

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

content/commands/ft.aggregate.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ syntax: "FT.AGGREGATE index query \n [VERBATIM] \n [LOAD count field [field ..
183183
\ \n [TIMEOUT timeout] \n [GROUPBY nargs property [property ...] [REDUCE function\
184184
\ nargs arg [arg ...] [AS name] [REDUCE function nargs arg [arg ...] [AS name]\
185185
\ ...]] ...]] \n [SORTBY nargs [property ASC | DESC [property ASC | DESC ...]]\
186-
\ [MAX num] [WITHCOUNT] \n [APPLY expression AS name [APPLY expression AS name\
186+
\ [MAX num] [WITHCOUNT | WITHOUTCOUNT]] \n [APPLY expression AS name [APPLY expression AS name\
187187
\ ...]] \n [LIMIT offset num] \n [FILTER filter] \n [WITHCURSOR [COUNT read_size]\
188188
\ [MAXIDLE idle_time]] \n [PARAMS nargs name value [name value ...]] \n [SCORER scorer]\n
189189
\ [ADDSCORES] \n [DIALECT\
@@ -282,6 +282,8 @@ Attributes needed for `SORTBY` should be stored as `SORTABLE` to be available wi
282282

283283
**Counts behavior**: optional `WITHCOUNT` argument returns accurate counts for the query results with sorting. This operation processes all results in order to get an accurate count, being less performant than the optimized option (default behavior on `DIALECT 4`)
284284

285+
You can also use `WITHOUTCOUNT` in place of `DIALECT 4` when used with either `FT.SEARCH` or `FT.AGGREGATE`.
286+
</details>
285287

286288
<details open>
287289
<summary><code>APPLY {expr} AS {name}</code></summary>

content/commands/ft.search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ syntax: "FT.SEARCH index query \n [NOCONTENT] \n [VERBATIM] \n [NOSTOPWORDS]
288288
\ [ FIELDS count field [field ...]] [ TAGS open close]] \n [SLOP slop] \n [TIMEOUT\
289289
\ timeout] \n [INORDER] \n [LANGUAGE language] \n [EXPANDER expander] \n [SCORER\
290290
\ scorer] \n [EXPLAINSCORE] \n [PAYLOAD payload] \n [SORTBY sortby [ ASC | DESC]\
291-
\ [WITHCOUNT]] \n [LIMIT offset num] \n [PARAMS nargs name value [ name value\
291+
\ [WITHCOUNT | WITHOUTCOUNT]] \n [LIMIT offset num] \n [PARAMS nargs name value [ name value\
292292
\ ...]] \n [DIALECT dialect]\n"
293293
syntax_fmt: "FT.SEARCH index query [NOCONTENT] [VERBATIM] [NOSTOPWORDS]\n [WITHSCORES]\
294294
\ [WITHPAYLOADS] [WITHSORTKEYS] [FILTER\_numeric_field\n min max [FILTER\_numeric_field\
@@ -483,9 +483,9 @@ orders the results by the value of this attribute. This applies to both text and
483483
- Hybrid - applied when there is a `SORTBY` clause over a numeric field and another non-numeric filter. Some results will get filtered, and the initial range may not be large enough. The iterator is then rewinding with the following ranges, and an additional iteration takes place to collect the `LIMIT` requested results.
484484
- No optimization - If there is a sort by score or by non-numeric field, there is no other option but to retrieve all results and compare their values.
485485

486-
**Counts behavior**: optional`WITHCOUNT`argument returns accurate counts for the query results with sorting. This operation processes all results in order to get an accurate count, being less performant than the optimized option (default behavior on `DIALECT 4`)
487-
486+
**Counts behavior**: optional `WITHCOUNT` argument returns accurate counts for the query results with sorting. This operation processes all results in order to get an accurate count, being less performant than the optimized option (default behavior on `DIALECT 4`)
488487

488+
You can also use `WITHOUTCOUNT` in place of `DIALECT 4` when used with either `FT.SEARCH` or `FT.AGGREGATE`.
489489
</details>
490490

491491
<details open>

content/develop/ai/search-and-query/advanced-concepts/dialects.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ Dialect version 4 will improve performance in four different scenarios:
208208
1. **Hybrid** - applied when there is a `SORTBY` on a numeric field in addition to another non-numeric filter. It could be the case that some results will get filtered, leaving too small a range to satisfy any specified `LIMIT`. In such cases, the iterator then is re-wound and additional iterations occur to collect result up to the requested `LIMIT`.
209209
1. **No optimization** - If there is a sort by score or by a non-numeric field, there is no other option but to retrieve all results and compare their values to the search parameters.
210210
211+
You can also use `WITHOUTCOUNT` in place of `DIALECT 4` when used with either FT.SEARCH or FT.AGGREGATE.
212+
211213
## Use `FT.EXPLAINCLI` to compare dialects
212214
213215
The [`FT.EXPLAINCLI`]({{< relref "commands/ft.explaincli/" >}}) command is a powerful tool that provides a window into the inner workings of your queries. It's like a roadmap that details your query's journey from start to finish.

0 commit comments

Comments
 (0)