Issue an aggregation query. ### Parameters **query**: This can be either an `AggregateRequest`, or a `Cursor` An `AggregateResult` object is returned. You can access the rows from its `rows` property, which will always yield the rows of the result.
(
self,
query: Union[AggregateResult, Cursor],
query_params: Optional[Dict[str, Union[str, int, float, bytes]]] = None,
)
| 1846 | return self._parse_results(HYBRID_CMD, res, **options) |
| 1847 | |
| 1848 | async def aggregate( |
| 1849 | self, |
| 1850 | query: Union[AggregateResult, Cursor], |
| 1851 | query_params: Optional[Dict[str, Union[str, int, float, bytes]]] = None, |
| 1852 | ): |
| 1853 | """ |
| 1854 | Issue an aggregation query. |
| 1855 | |
| 1856 | ### Parameters |
| 1857 | |
| 1858 | **query**: This can be either an `AggregateRequest`, or a `Cursor` |
| 1859 | |
| 1860 | An `AggregateResult` object is returned. You can access the rows from |
| 1861 | its `rows` property, which will always yield the rows of the result. |
| 1862 | |
| 1863 | For more information see `FT.AGGREGATE <https://redis.io/commands/ft.aggregate>`_. |
| 1864 | """ # noqa |
| 1865 | if isinstance(query, AggregateRequest): |
| 1866 | has_cursor = bool(query._cursor) |
| 1867 | cmd = [AGGREGATE_CMD, self.index_name] + query.build_args() |
| 1868 | elif isinstance(query, Cursor): |
| 1869 | has_cursor = True |
| 1870 | cmd = [CURSOR_CMD, "READ", self.index_name] + query.build_args() |
| 1871 | else: |
| 1872 | raise ValueError("Bad query", query) |
| 1873 | cmd += self.get_params_args(query_params) |
| 1874 | |
| 1875 | raw = await self.execute_command(*cmd) |
| 1876 | return self._parse_results( |
| 1877 | AGGREGATE_CMD, raw, query=query, has_cursor=has_cursor |
| 1878 | ) |
| 1879 | |
| 1880 | async def spellcheck(self, query, distance=None, include=None, exclude=None): |
| 1881 | """ |
nothing calls this directly
no test coverage detected