@@ -462,12 +462,14 @@ public suspend fun SearchClient.partialUpdateObjects(
462
462
* @param indexName The index in which to perform the request.
463
463
* @param objects The list of objects to replace.
464
464
* @param batchSize The size of the batch. Default is 1000.
465
+ * @param scopes The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
465
466
* @return responses from the three-step operations: copy, batch, move.
466
467
*/
467
468
public suspend fun SearchClient.replaceAllObjects (
468
469
indexName : String ,
469
470
objects : List <JsonObject >,
470
471
batchSize : Int = 1000,
472
+ scopes : List <ScopeType > = listOf(ScopeType .Settings , ScopeType .Rules , ScopeType .Synonyms ),
471
473
requestOptions : RequestOptions ? = null,
472
474
): ReplaceAllObjectsResponse {
473
475
val tmpIndexName = " ${indexName} _tmp_${Random .nextInt(from = 0 , until = 100 )} "
@@ -478,7 +480,7 @@ public suspend fun SearchClient.replaceAllObjects(
478
480
operationIndexParams = OperationIndexParams (
479
481
operation = OperationType .Copy ,
480
482
destination = tmpIndexName,
481
- scope = listOf ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ) ,
483
+ scope = scopes ,
482
484
),
483
485
requestOptions = requestOptions,
484
486
)
@@ -499,7 +501,7 @@ public suspend fun SearchClient.replaceAllObjects(
499
501
operationIndexParams = OperationIndexParams (
500
502
operation = OperationType .Copy ,
501
503
destination = tmpIndexName,
502
- scope = listOf ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ) ,
504
+ scope = scopes ,
503
505
),
504
506
requestOptions = requestOptions,
505
507
)
0 commit comments