@@ -548,13 +548,15 @@ public extension SearchClient {
548
548
/// - parameter indexName: The name of the index where to replace the objects
549
549
/// - parameter objects: The new objects
550
550
/// - parameter batchSize: The maximum number of objects to include in a batch
551
+ /// - parameter scopes: The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms']
551
552
/// - parameter requestOptions: The request options
552
553
/// - returns: ReplaceAllObjectsResponse
553
554
@discardableResult
554
555
func replaceAllObjects(
555
556
indexName: String ,
556
557
objects: [ some Encodable ] ,
557
558
batchSize: Int = 1000 ,
559
+ scopes: [ ScopeType ] = [ . settings, . rules, . synonyms] ,
558
560
requestOptions: RequestOptions ? = nil
559
561
) async throws -> ReplaceAllObjectsResponse {
560
562
let tmpIndexName = " \( indexName) _tmp_ \( Int . random ( in: 1_000_000 ..< 10_000_000 ) ) "
@@ -565,7 +567,7 @@ public extension SearchClient {
565
567
operationIndexParams: OperationIndexParams (
566
568
operation: . copy,
567
569
destination: tmpIndexName,
568
- scope: [ . settings , . rules , . synonyms ]
570
+ scope: scopes
569
571
) ,
570
572
requestOptions: requestOptions
571
573
)
@@ -584,7 +586,7 @@ public extension SearchClient {
584
586
operationIndexParams: OperationIndexParams (
585
587
operation: . copy,
586
588
destination: tmpIndexName,
587
- scope: [ . settings , . rules , . synonyms ]
589
+ scope: scopes
588
590
) ,
589
591
requestOptions: requestOptions
590
592
)
0 commit comments