@@ -462,12 +462,14 @@ public suspend fun SearchClient.partialUpdateObjects(
462462 * @param indexName The index in which to perform the request.
463463 * @param objects The list of objects to replace.
464464 * @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'].
465466 * @return responses from the three-step operations: copy, batch, move.
466467 */
467468public suspend fun SearchClient.replaceAllObjects (
468469 indexName : String ,
469470 objects : List <JsonObject >,
470471 batchSize : Int = 1000,
472+ scopes : List <ScopeType > = listOf(ScopeType .Settings , ScopeType .Rules , ScopeType .Synonyms ),
471473 requestOptions : RequestOptions ? = null,
472474): ReplaceAllObjectsResponse {
473475 val tmpIndexName = " ${indexName} _tmp_${Random .nextInt(from = 0 , until = 100 )} "
@@ -478,7 +480,7 @@ public suspend fun SearchClient.replaceAllObjects(
478480 operationIndexParams = OperationIndexParams (
479481 operation = OperationType .Copy ,
480482 destination = tmpIndexName,
481- scope = listOf ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ) ,
483+ scope = scopes ,
482484 ),
483485 requestOptions = requestOptions,
484486 )
@@ -499,7 +501,7 @@ public suspend fun SearchClient.replaceAllObjects(
499501 operationIndexParams = OperationIndexParams (
500502 operation = OperationType .Copy ,
501503 destination = tmpIndexName,
502- scope = listOf ( ScopeType . Settings , ScopeType . Rules , ScopeType . Synonyms ) ,
504+ scope = scopes ,
503505 ),
504506 requestOptions = requestOptions,
505507 )
0 commit comments