From 08ccc66570d21e1f81f864faf81a5c31b4a0d539 Mon Sep 17 00:00:00 2001 From: Hunter Hogan Date: Mon, 28 Jul 2025 20:02:52 -0500 Subject: [PATCH] Typos in query.py --- redis/commands/search/query.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/redis/commands/search/query.py b/redis/commands/search/query.py index a8312a2ad2..ee281fafd0 100644 --- a/redis/commands/search/query.py +++ b/redis/commands/search/query.py @@ -9,7 +9,7 @@ class Query: the query string. The query string is set in the constructor, and other options have setter functions. - The setter functions return the query object, so they can be chained, + The setter functions return the query object so they can be chained. i.e. `Query("foo").verbatim().filter(...)` etc. """ @@ -95,12 +95,12 @@ def summarize( ) -> "Query": """ Return an abridged format of the field, containing only the segments of - the field which contain the matching term(s). + the field that contain the matching term(s). If `fields` is specified, then only the mentioned fields are - summarized; otherwise all results are summarized. + summarized; otherwise, all results are summarized. - Server side defaults are used for each option (except `fields`) + Server-side defaults are used for each option (except `fields`) if not specified - **fields** List of fields to summarize. All fields are summarized @@ -130,7 +130,7 @@ def highlight( """ Apply specified markup to matched term(s) within the returned field(s). - - **fields** If specified then only those mentioned fields are + - **fields** If specified, then only those mentioned fields are highlighted, otherwise all fields are highlighted - **tags** A list of two strings to surround the match. """ @@ -154,7 +154,7 @@ def language(self, language: str) -> "Query": return self def slop(self, slop: int) -> "Query": - """Allow a maximum of N intervening non matched terms between + """Allow a maximum of N intervening non-matched terms between phrase terms (0 means exact phrase). """ self._slop = slop @@ -169,7 +169,7 @@ def in_order(self) -> "Query": """ Match only documents where the query terms appear in the same order in the document. - i.e. for the query "hello world", we do not match "world hello" + i.e., for the query "hello world", we do not match "world hello" """ self._in_order = True return self @@ -258,7 +258,7 @@ def paging(self, offset: int, num: int) -> "Query": return self def verbatim(self) -> "Query": - """Set the query to be verbatim, i.e. use no query expansion + """Set the query to be verbatim, i.e., use no query expansion or stemming. """ self._verbatim = True @@ -292,7 +292,7 @@ def limit_fields(self, *fields: List[str]) -> "Query": """ Limit the search to specific TEXT fields only. - - **fields**: A list of strings, case sensitive field names + - **fields**: A list of strings; case-sensitive field names from the defined schema. """ self._fields = fields @@ -301,7 +301,7 @@ def limit_fields(self, *fields: List[str]) -> "Query": def add_filter(self, flt: "Filter") -> "Query": """ Add a numeric or geo filter to the query. - **Currently only one of each filter is supported by the engine** + **Currently, only one of each filter is supported by the engine** - **flt**: A NumericFilter or GeoFilter object, used on a corresponding field @@ -315,14 +315,14 @@ def sort_by(self, field: str, asc: bool = True) -> "Query": Add a sortby field to the query. - **field** - the name of the field to sort by - - **asc** - when `True`, sorting will be done in asceding order + - **asc** - when `True`, sorting will be done in ascending order """ self._sortby = SortbyField(field, asc) return self def expander(self, expander: str) -> "Query": """ - Add a expander field to the query. + Add an expander field to the query. - **expander** - the name of the expander """