File tree 4 files changed +24
-6
lines changed
4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ explicitly:
98
98
99
99
Delete By Query
100
100
~~~~~~~~~~~~~~~
101
+
101
102
You can delete the documents matching a search by calling ``delete `` on the ``Search `` object instead of
102
103
``execute `` like this:
103
104
@@ -106,6 +107,14 @@ You can delete the documents matching a search by calling ``delete`` on the ``Se
106
107
s = Search(index = ' i' ).query(" match" , title = " python" )
107
108
response = s.delete()
108
109
110
+ To pass deletion parameters in your query, you can add them by calling ``params `` on the ``Search `` object before
111
+ ``delete `` like this:
112
+
113
+ .. code :: python
114
+
115
+ s = Search(index = ' i' ).query(" match" , title = " python" )
116
+ s = s.params(ignore_unavailable = False , wait_for_completion = True )
117
+ response = s.delete()
109
118
110
119
111
120
Queries
Original file line number Diff line number Diff line change @@ -106,9 +106,9 @@ async def scan(self) -> AsyncIterator[_R]:
106
106
Turn the search into a scan search and return a generator that will
107
107
iterate over all the documents matching the query.
108
108
109
- Use ``params`` method to specify any additional arguments you with to
109
+ Use the ``params`` method to specify any additional arguments you wish to
110
110
pass to the underlying ``scan`` helper from ``elasticsearch-py`` -
111
- https://elasticsearch-py.readthedocs.io/en/master /helpers.html#elasticsearch.helpers. scan
111
+ https://elasticsearch-py.readthedocs.io/en/latest /helpers.html#scan
112
112
113
113
The ``iterate()`` method should be preferred, as it provides similar
114
114
functionality using an Elasticsearch point in time.
@@ -123,6 +123,11 @@ async def scan(self) -> AsyncIterator[_R]:
123
123
async def delete (self ) -> AttrDict [Any ]:
124
124
"""
125
125
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/async.html#elasticsearch.AsyncElasticsearch.delete_by_query
126
131
"""
127
132
128
133
es = get_connection (self ._using )
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ def scan(self) -> Iterator[_R]:
95
95
Turn the search into a scan search and return a generator that will
96
96
iterate over all the documents matching the query.
97
97
98
- Use ``params`` method to specify any additional arguments you with to
98
+ Use the ``params`` method to specify any additional arguments you wish to
99
99
pass to the underlying ``scan`` helper from ``elasticsearch-py`` -
100
- https://elasticsearch-py.readthedocs.io/en/master /helpers.html#elasticsearch.helpers. scan
100
+ https://elasticsearch-py.readthedocs.io/en/latest /helpers.html#scan
101
101
102
102
The ``iterate()`` method should be preferred, as it provides similar
103
103
functionality using an Elasticsearch point in time.
@@ -109,7 +109,11 @@ def scan(self) -> Iterator[_R]:
109
109
110
110
def delete (self ) -> AttrDict [Any ]:
111
111
"""
112
- delete() executes the query by delegating to delete_by_query()
112
+ ``delete()`` executes the query by delegating to ``delete_by_query()``.
113
+
114
+ Use the ``params`` method to specify any additional arguments you wish to
115
+ pass to the underlying ``delete_by_query`` helper from ``elasticsearch-py`` -
116
+ https://elasticsearch-py.readthedocs.io/en/latest/api/elasticsearch.html#elasticsearch.Elasticsearch.delete_by_query
113
117
"""
114
118
115
119
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