File tree 4 files changed +24
-7
lines changed
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ s = Search(index='i').query(Match("title", "python"))
84
84
response = s.delete()
85
85
```
86
86
87
+ To pass [ deletion parameters] ( https://elasticsearch-py.readthedocs.io/en/latest/api/elasticsearch.html#elasticsearch.Elasticsearch.delete_by_query )
88
+ in your query, you can add them by calling `` params `` on the `` Search `` object before `` delete `` like this:
89
+
90
+ ``` python
91
+ s = Search(index = ' i' ).query(" match" , title = " python" )
92
+ s = s.params(ignore_unavailable = False , wait_for_completion = True )
93
+ response = s.delete()
94
+ ```
95
+
87
96
88
97
#### Queries [ _ queries]
89
98
Original file line number Diff line number Diff line change @@ -107,9 +107,9 @@ async def scan(self) -> AsyncIterator[_R]:
107
107
Turn the search into a scan search and return a generator that will
108
108
iterate over all the documents matching the query.
109
109
110
- Use ``params`` method to specify any additional arguments you with to
110
+ Use the ``params`` method to specify any additional arguments you wish to
111
111
pass to the underlying ``scan`` helper from ``elasticsearch-py`` -
112
- https://elasticsearch-py.readthedocs.io/en/master /helpers.html#elasticsearch.helpers. scan
112
+ https://elasticsearch-py.readthedocs.io/en/latest /helpers.html#scan
113
113
114
114
The ``iterate()`` method should be preferred, as it provides similar
115
115
functionality using an Elasticsearch point in time.
@@ -123,7 +123,11 @@ async def scan(self) -> AsyncIterator[_R]:
123
123
124
124
async def delete (self ) -> AttrDict [Any ]:
125
125
"""
126
- delete() executes the query by delegating to delete_by_query()
126
+ ``delete()`` executes the query by delegating to ``delete_by_query()``.
127
+
128
+ Use the ``params`` method to specify any additional arguments you wish to
129
+ pass to the underlying ``delete_by_query`` helper from ``elasticsearch-py`` -
130
+ https://elasticsearch-py.readthedocs.io/en/latest/api/elasticsearch.html#elasticsearch.Elasticsearch.delete_by_query
127
131
"""
128
132
129
133
es = get_connection (self ._using )
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ def scan(self) -> Iterator[_R]:
104
104
Turn the search into a scan search and return a generator that will
105
105
iterate over all the documents matching the query.
106
106
107
- Use ``params`` method to specify any additional arguments you with to
107
+ Use the ``params`` method to specify any additional arguments you wish to
108
108
pass to the underlying ``scan`` helper from ``elasticsearch-py`` -
109
- https://elasticsearch-py.readthedocs.io/en/master /helpers.html#elasticsearch.helpers. scan
109
+ https://elasticsearch-py.readthedocs.io/en/latest /helpers.html#scan
110
110
111
111
The ``iterate()`` method should be preferred, as it provides similar
112
112
functionality using an Elasticsearch point in time.
@@ -118,7 +118,11 @@ def scan(self) -> Iterator[_R]:
118
118
119
119
def delete (self ) -> AttrDict [Any ]:
120
120
"""
121
- delete() executes the query by delegating to delete_by_query()
121
+ ``delete()`` executes the query by delegating to ``delete_by_query()``.
122
+
123
+ Use the ``params`` method to specify any additional arguments you wish to
124
+ pass to the underlying ``delete_by_query`` helper from ``elasticsearch-py`` -
125
+ https://elasticsearch-py.readthedocs.io/en/latest/api/elasticsearch.html#elasticsearch.Elasticsearch.delete_by_query
122
126
"""
123
127
124
128
es = get_connection (self ._using )
Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ def params(self, **kwargs: Any) -> None:
469
469
"""
470
470
Specify query params to be used when executing the search. All the
471
471
keyword arguments will override the current values. See
472
- https://elasticsearch-py.readthedocs.io/en/master /api.html#elasticsearch.Elasticsearch.search
472
+ https://elasticsearch-py.readthedocs.io/en/latest /api/elasticsearch .html#elasticsearch.Elasticsearch.search
473
473
for all available parameters.
474
474
"""
475
475
self ._s = self ._s .params (** kwargs )
You can’t perform that action at this time.
0 commit comments