@@ -9,7 +9,7 @@ class Query:
9
9
the query string. The query string is set in the constructor, and other
10
10
options have setter functions.
11
11
12
- The setter functions return the query object, so they can be chained,
12
+ The setter functions return the query object so they can be chained.
13
13
i.e. `Query("foo").verbatim().filter(...)` etc.
14
14
"""
15
15
@@ -95,12 +95,12 @@ def summarize(
95
95
) -> "Query" :
96
96
"""
97
97
Return an abridged format of the field, containing only the segments of
98
- the field which contain the matching term(s).
98
+ the field that contain the matching term(s).
99
99
100
100
If `fields` is specified, then only the mentioned fields are
101
- summarized; otherwise all results are summarized.
101
+ summarized; otherwise, all results are summarized.
102
102
103
- Server side defaults are used for each option (except `fields`)
103
+ Server- side defaults are used for each option (except `fields`)
104
104
if not specified
105
105
106
106
- **fields** List of fields to summarize. All fields are summarized
@@ -130,7 +130,7 @@ def highlight(
130
130
"""
131
131
Apply specified markup to matched term(s) within the returned field(s).
132
132
133
- - **fields** If specified then only those mentioned fields are
133
+ - **fields** If specified, then only those mentioned fields are
134
134
highlighted, otherwise all fields are highlighted
135
135
- **tags** A list of two strings to surround the match.
136
136
"""
@@ -154,7 +154,7 @@ def language(self, language: str) -> "Query":
154
154
return self
155
155
156
156
def slop (self , slop : int ) -> "Query" :
157
- """Allow a maximum of N intervening non matched terms between
157
+ """Allow a maximum of N intervening non- matched terms between
158
158
phrase terms (0 means exact phrase).
159
159
"""
160
160
self ._slop = slop
@@ -169,7 +169,7 @@ def in_order(self) -> "Query":
169
169
"""
170
170
Match only documents where the query terms appear in
171
171
the same order in the document.
172
- i.e. for the query "hello world", we do not match "world hello"
172
+ i.e., for the query "hello world", we do not match "world hello"
173
173
"""
174
174
self ._in_order = True
175
175
return self
@@ -258,7 +258,7 @@ def paging(self, offset: int, num: int) -> "Query":
258
258
return self
259
259
260
260
def verbatim (self ) -> "Query" :
261
- """Set the query to be verbatim, i.e. use no query expansion
261
+ """Set the query to be verbatim, i.e., use no query expansion
262
262
or stemming.
263
263
"""
264
264
self ._verbatim = True
@@ -292,7 +292,7 @@ def limit_fields(self, *fields: List[str]) -> "Query":
292
292
"""
293
293
Limit the search to specific TEXT fields only.
294
294
295
- - **fields**: A list of strings, case sensitive field names
295
+ - **fields**: A list of strings; case- sensitive field names
296
296
from the defined schema.
297
297
"""
298
298
self ._fields = fields
@@ -301,7 +301,7 @@ def limit_fields(self, *fields: List[str]) -> "Query":
301
301
def add_filter (self , flt : "Filter" ) -> "Query" :
302
302
"""
303
303
Add a numeric or geo filter to the query.
304
- **Currently only one of each filter is supported by the engine**
304
+ **Currently, only one of each filter is supported by the engine**
305
305
306
306
- **flt**: A NumericFilter or GeoFilter object, used on a
307
307
corresponding field
@@ -315,14 +315,14 @@ def sort_by(self, field: str, asc: bool = True) -> "Query":
315
315
Add a sortby field to the query.
316
316
317
317
- **field** - the name of the field to sort by
318
- - **asc** - when `True`, sorting will be done in asceding order
318
+ - **asc** - when `True`, sorting will be done in ascending order
319
319
"""
320
320
self ._sortby = SortbyField (field , asc )
321
321
return self
322
322
323
323
def expander (self , expander : str ) -> "Query" :
324
324
"""
325
- Add a expander field to the query.
325
+ Add an expander field to the query.
326
326
327
327
- **expander** - the name of the expander
328
328
"""
0 commit comments