@@ -254,6 +254,8 @@ package object extension {
254254 * The list of objects to save.
255255 * @param waitForTasks
256256 * Whether to wait for the tasks to complete.
257+ * @param batchSize
258+ * The size of the batch. Default is 1000.
257259 * @param requestOptions
258260 * Additional request configuration.
259261 * @return
@@ -263,9 +265,10 @@ package object extension {
263265 indexName : String ,
264266 objects : Seq [Any ],
265267 waitForTasks : Boolean = false ,
268+ batchSize : Int = 1000 ,
266269 requestOptions : Option [RequestOptions ] = None
267270 )(implicit ec : ExecutionContext ): Future [Seq [BatchResponse ]] = {
268- chunkedBatch(indexName, objects, Action .AddObject , waitForTasks, 1000 , requestOptions)
271+ chunkedBatch(indexName, objects, Action .AddObject , waitForTasks, batchSize , requestOptions)
269272 }
270273
271274 /** Helper: Deletes every objects for the given objectIDs. The `chunkedBatch` helper is used under the hood, which
@@ -277,6 +280,8 @@ package object extension {
277280 * The list of objectIDs to delete.
278281 * @param waitForTasks
279282 * Whether to wait for the tasks to complete.
283+ * @param batchSize
284+ * The size of the batch. Default is 1000.
280285 * @param requestOptions
281286 * Additional request configuration.
282287 * @return
@@ -286,14 +291,15 @@ package object extension {
286291 indexName : String ,
287292 objectIDs : Seq [String ],
288293 waitForTasks : Boolean = false ,
294+ batchSize : Int = 1000 ,
289295 requestOptions : Option [RequestOptions ] = None
290296 )(implicit ec : ExecutionContext ): Future [Seq [BatchResponse ]] = {
291297 chunkedBatch(
292298 indexName,
293299 objectIDs.map(id => new { val objectID : String = id }),
294300 Action .DeleteObject ,
295301 waitForTasks,
296- 1000 ,
302+ batchSize ,
297303 requestOptions
298304 )
299305 }
@@ -309,6 +315,8 @@ package object extension {
309315 * To be provided if non-existing objects are passed, otherwise, the call will fail.
310316 * @param waitForTasks
311317 * Whether to wait for the tasks to complete.
318+ * @param batchSize
319+ * The size of the batch. Default is 1000.
312320 * @param requestOptions
313321 * Additional request configuration.
314322 * @return
@@ -319,14 +327,15 @@ package object extension {
319327 objects : Seq [Any ],
320328 createIfNotExists : Boolean = false ,
321329 waitForTasks : Boolean = false ,
330+ batchSize : Int = 1000 ,
322331 requestOptions : Option [RequestOptions ] = None
323332 )(implicit ec : ExecutionContext ): Future [Seq [BatchResponse ]] = {
324333 chunkedBatch(
325334 indexName,
326335 objects,
327336 if (createIfNotExists) Action .PartialUpdateObject else Action .PartialUpdateObjectNoCreate ,
328337 waitForTasks,
329- 1000 ,
338+ batchSize ,
330339 requestOptions
331340 )
332341 }
0 commit comments