@@ -353,6 +353,8 @@ package object extension {
353353 * The list of objects to replace.
354354 * @param batchSize
355355 * The size of the batch. Default is 1000.
356+ * @param scopes
357+ * The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
356358 * @param requestOptions
357359 * Additional request configuration.
358360 * @return
@@ -362,6 +364,7 @@ package object extension {
362364 indexName : String ,
363365 objects : Seq [Any ],
364366 batchSize : Int = 1000 ,
367+ scopes : Option [Seq [ScopeType ]] = Some (Seq (ScopeType .Settings , ScopeType .Rules , ScopeType .Synonyms )),
365368 requestOptions : Option [RequestOptions ] = None
366369 )(implicit ec : ExecutionContext ): Future [ReplaceAllObjectsResponse ] = {
367370 val tmpIndexName = s " ${indexName}_tmp_ ${scala.util.Random .nextInt(100 )}"
@@ -373,7 +376,7 @@ package object extension {
373376 operationIndexParams = OperationIndexParams (
374377 operation = OperationType .Copy ,
375378 destination = tmpIndexName,
376- scope = Some ( Seq ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ))
379+ scope = scopes
377380 ),
378381 requestOptions = requestOptions
379382 )
@@ -394,7 +397,7 @@ package object extension {
394397 operationIndexParams = OperationIndexParams (
395398 operation = OperationType .Copy ,
396399 destination = tmpIndexName,
397- scope = Some ( Seq ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ))
400+ scope = scopes
398401 ),
399402 requestOptions = requestOptions
400403 )
0 commit comments