@@ -353,6 +353,8 @@ package object extension {
353
353
* The list of objects to replace.
354
354
* @param batchSize
355
355
* The size of the batch. Default is 1000.
356
+ * @param scopes
357
+ * The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
356
358
* @param requestOptions
357
359
* Additional request configuration.
358
360
* @return
@@ -362,6 +364,7 @@ package object extension {
362
364
indexName : String ,
363
365
objects : Seq [Any ],
364
366
batchSize : Int = 1000 ,
367
+ scopes : Option [Seq [ScopeType ]] = Some (Seq (ScopeType .Settings , ScopeType .Rules , ScopeType .Synonyms )),
365
368
requestOptions : Option [RequestOptions ] = None
366
369
)(implicit ec : ExecutionContext ): Future [ReplaceAllObjectsResponse ] = {
367
370
val tmpIndexName = s " ${indexName}_tmp_ ${scala.util.Random .nextInt(100 )}"
@@ -373,7 +376,7 @@ package object extension {
373
376
operationIndexParams = OperationIndexParams (
374
377
operation = OperationType .Copy ,
375
378
destination = tmpIndexName,
376
- scope = Some ( Seq ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ))
379
+ scope = scopes
377
380
),
378
381
requestOptions = requestOptions
379
382
)
@@ -394,7 +397,7 @@ package object extension {
394
397
operationIndexParams = OperationIndexParams (
395
398
operation = OperationType .Copy ,
396
399
destination = tmpIndexName,
397
- scope = Some ( Seq ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ))
400
+ scope = scopes
398
401
),
399
402
requestOptions = requestOptions
400
403
)
0 commit comments