File tree Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Expand file tree Collapse file tree 4 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ explicitly:
9898
9999 Delete By Query
100100~~~~~~~~~~~~~~~
101+
101102You can delete the documents matching a search by calling ``delete `` on the ``Search `` object instead of
102103``execute `` like this:
103104
@@ -106,6 +107,14 @@ You can delete the documents matching a search by calling ``delete`` on the ``Se
106107 s = Search(index = ' i' ).query(" match" , title = " python" )
107108 response = s.delete()
108109
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()
109118
110119
111120 Queries
Original file line number Diff line number Diff line change @@ -106,9 +106,9 @@ async def scan(self) -> AsyncIterator[_R]:
106106 Turn the search into a scan search and return a generator that will
107107 iterate over all the documents matching the query.
108108
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
110110 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
112112
113113 The ``iterate()`` method should be preferred, as it provides similar
114114 functionality using an Elasticsearch point in time.
@@ -123,6 +123,11 @@ async def scan(self) -> AsyncIterator[_R]:
123123 async def delete (self ) -> AttrDict [Any ]:
124124 """
125125 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
126131 """
127132
128133 es = get_connection (self ._using )
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ def scan(self) -> Iterator[_R]:
9595 Turn the search into a scan search and return a generator that will
9696 iterate over all the documents matching the query.
9797
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
9999 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
101101
102102 The ``iterate()`` method should be preferred, as it provides similar
103103 functionality using an Elasticsearch point in time.
@@ -109,7 +109,11 @@ def scan(self) -> Iterator[_R]:
109109
110110 def delete (self ) -> AttrDict [Any ]:
111111 """
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
113117 """
114118
115119 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:
469469 """
470470 Specify query params to be used when executing the search. All the
471471 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
473473 for all available parameters.
474474 """
475475 self ._s = self ._s .params (** kwargs )
You can’t perform that action at this time.
0 commit comments