MCPcopy
hub / github.com/redis/redis-py / sort_by

Method sort_by

redis/commands/search/query.py:313–321  ·  redis/commands/search/query.py::Query.sort_by

Add a sortby field to the query. - **field** - the name of the field to sort by - **asc** - when `True`, sorting will be done in ascending order

(self, field: str, asc: bool = True)

Source from the content-addressed store, hash-verified

311 return self
312
313 def sort_by(self, field: str, asc: bool = True) -> class="st">"Query":
314 class="st">"""
315 Add a sortby field to the query.
316
317 - **field** - the name of the field to sort by
318 - **asc** - when `True`, sorting will be done in ascending order
319 class="st">"""
320 self._sortby = SortbyField(field, asc)
321 return self
322
323 def expander(self, expander: str) -> class="st">"Query":
324 class="st">"""

Calls 1

SortbyFieldClass · 0.85