File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Expand file tree Collapse file tree 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"))
8484response = s.delete()
8585```
8686
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+
8796
8897#### Queries [ _ queries]
8998
Original file line number Diff line number Diff line change @@ -107,9 +107,9 @@ async def scan(self) -> AsyncIterator[_R]:
107107 Turn the search into a scan search and return a generator that will
108108 iterate over all the documents matching the query.
109109
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
111111 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
113113
114114 The ``iterate()`` method should be preferred, as it provides similar
115115 functionality using an Elasticsearch point in time.
@@ -123,7 +123,11 @@ async def scan(self) -> AsyncIterator[_R]:
123123
124124 async def delete (self ) -> AttrDict [Any ]:
125125 """
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
127131 """
128132
129133 es = get_connection (self ._using )
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ def scan(self) -> Iterator[_R]:
104104 Turn the search into a scan search and return a generator that will
105105 iterate over all the documents matching the query.
106106
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
108108 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
110110
111111 The ``iterate()`` method should be preferred, as it provides similar
112112 functionality using an Elasticsearch point in time.
@@ -118,7 +118,11 @@ def scan(self) -> Iterator[_R]:
118118
119119 def delete (self ) -> AttrDict [Any ]:
120120 """
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
122126 """
123127
124128 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