|
256 | 256 | self, |
257 | 257 | index_name: str, |
258 | 258 | objects: List[Dict[str, Any]], |
| 259 | + wait_for_tasks: bool = false, |
259 | 260 | request_options: Optional[Union[dict, RequestOptions]] = None, |
260 | 261 | ) -> List[BatchResponse]: |
261 | 262 | """ |
262 | 263 | Helper: Saves the given array of objects in the given index. The `chunked_batch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it. |
263 | 264 | """ |
264 | | - return {{^isSyncClient}}await {{/isSyncClient}}self.chunked_batch(index_name=index_name, objects=objects, action=Action.ADDOBJECT, request_options=request_options) |
| 265 | + return {{^isSyncClient}}await {{/isSyncClient}}self.chunked_batch(index_name=index_name, objects=objects, action=Action.ADDOBJECT, wait_for_tasks=wait_for_tasks, request_options=request_options) |
265 | 266 |
|
266 | 267 | {{^isSyncClient}}async {{/isSyncClient}}def delete_objects( |
267 | 268 | self, |
268 | 269 | index_name: str, |
269 | 270 | object_ids: List[str], |
| 271 | + wait_for_tasks: bool = false, |
270 | 272 | request_options: Optional[Union[dict, RequestOptions]] = None, |
271 | 273 | ) -> List[BatchResponse]: |
272 | 274 | """ |
273 | 275 | Helper: Deletes every records for the given objectIDs. The `chunked_batch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it. |
274 | 276 | """ |
275 | | - return {{^isSyncClient}}await {{/isSyncClient}}self.chunked_batch(index_name=index_name, objects=[{"objectID": id} for id in object_ids], action=Action.DELETEOBJECT, request_options=request_options) |
| 277 | + return {{^isSyncClient}}await {{/isSyncClient}}self.chunked_batch(index_name=index_name, objects=[{"objectID": id} for id in object_ids], action=Action.DELETEOBJECT, wait_for_tasks=wait_for_tasks, request_options=request_options) |
276 | 278 |
|
277 | 279 | {{^isSyncClient}}async {{/isSyncClient}}def partial_update_objects( |
278 | 280 | self, |
|
0 commit comments