Open samgqroberts opened 2 years ago
Update: I'm slowly learning that maybe the first value in the search_result (filtered_total
in the code snippet) is sometimes but isn't always guaranteed to be the filtered total, so maybe some of my analysis above doesn't apply, though I'm having a hard time finding good documentation on it.
Hi all - first off, love the project!
Using:
redisearch==2.1.1
I ran into an issue with
Client.aggregate
using anAggregateRequest
. I want to put aLIMIT 0 0
on one of my aggregate queries, but if I useAggregateRequest.limit(0, 0)
noLIMIT
is appended to the query statement.Here's a little reproduction using
build_args()
.I believe I have found a related sibling issue as well that explains why this is the case. The only reason to use a
LIMIT 0 0
is to count the number of results under a particular filter state without wasting resources retrieving any of those results. The related issue is that I can't find any way to get the number of results from anAggregateResult
response. My hunch is that that was never added toAggregateResult
, and therefore there was no way to use redisearch-py's aggregate facilities in a way that madeLIMIT 0 0
sensible to use.For the record, I've unfortunately had to reach past the abstraction here and use the redis python client directly, like this:
Note here that I'm actually using the bug with
.limit(0, 0)
to wipe out anyLimit
information currently on theAggregateRequest
.