diff options
author | DvirDukhan <dvir@redis.com> | 2023-01-02 16:28:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 16:28:53 +0200 |
commit | ed38e77050241a84c0108e47254d1804e8640531 (patch) | |
tree | 6aa3182a4f3c509820e35cbe242666e373514c1f /redis/commands/search | |
parent | f10c81ac2406fc9cacea0f2e9938910db1c751e5 (diff) | |
download | redis-py-ed38e77050241a84c0108e47254d1804e8640531.tar.gz |
Add dialect to ft aggregate (#2537)
* add dialect to aggregate request
* added test
* format
* async test
Diffstat (limited to 'redis/commands/search')
-rw-r--r-- | redis/commands/search/aggregation.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/redis/commands/search/aggregation.py b/redis/commands/search/aggregation.py index a171fa1..93a3d92 100644 --- a/redis/commands/search/aggregation.py +++ b/redis/commands/search/aggregation.py @@ -108,6 +108,7 @@ class AggregateRequest: self._with_schema = False self._verbatim = False self._cursor = [] + self._dialect = None def load(self, *fields): """ @@ -321,10 +322,22 @@ class AggregateRequest: ret.append(str(len(self._loadfields))) ret.extend(self._loadfields) + if self._dialect: + ret.extend(["DIALECT", self._dialect]) + ret.extend(self._aggregateplan) return ret + def dialect(self, dialect): + """ + Add a dialect field to the aggregate command. + + - **dialect** - dialect version to execute the query under + """ + self._dialect = dialect + return self + class Cursor: def __init__(self, cid): |