Skip to content

Commit 1bc6017

Browse files
author
Clément Le Provost
committed
Use new format when retrieving settings
… except during offline mode sync. Fixes #134.
1 parent 56180b9 commit 1bc6017

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Source/Index.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ import Foundation
370370
///
371371
@objc(getSettings:)
372372
@discardableResult public func getSettings(completionHandler: @escaping CompletionHandler) -> Operation {
373-
let path = "1/indexes/\(urlEncodedName)/settings"
373+
let path = "1/indexes/\(urlEncodedName)/settings?getVersion=2"
374374
return client.performHTTPQuery(path: path, method: .GET, body: nil, hostnames: client.readHosts, completionHandler: completionHandler)
375375
}
376376

Source/Offline/MirroredIndex.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ import Foundation
336336
syncError = nil
337337

338338
// Task: Download index settings.
339-
// TODO: Factorize query construction with regular code.
340-
let path = "1/indexes/\(urlEncodedName)/settings"
339+
// WARNING: We must use the legacy format to retrieve synonyms, alternative corrections & placeholders.
340+
let path = "1/indexes/\(urlEncodedName)/settings?getVersion=1"
341341
let settingsOperation = client.newRequest(method: .GET, path: path, body: nil, hostnames: client.readHosts, isSearchQuery: false) {
342342
(json, error) in
343343
if error != nil {

0 commit comments

Comments
 (0)