Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 0cdfe3c

Browse files
author
Clément Le Provost
committed
Merge branch 'fix/settings-version'
2 parents 0c25420 + 23f768a commit 0cdfe3c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

algoliasearch/src/main/java/com/algolia/search/saas/Index.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public Request getSettingsAsync(@NonNull CompletionHandler completionHandler) {
502502
return getClient().new AsyncTaskRequest(completionHandler) {
503503
@NonNull
504504
@Override JSONObject run() throws AlgoliaException {
505-
return getSettings();
505+
return getSettings(2);
506506
}
507507
}.start();
508508
}
@@ -1021,8 +1021,8 @@ protected JSONObject waitTask(String taskID) throws AlgoliaException {
10211021
*
10221022
* @throws AlgoliaException
10231023
*/
1024-
protected JSONObject getSettings() throws AlgoliaException {
1025-
return client.getRequest("/1/indexes/" + encodedIndexName + "/settings", false);
1024+
protected JSONObject getSettings(int formatVersion) throws AlgoliaException {
1025+
return client.getRequest("/1/indexes/" + encodedIndexName + "/settings?getVersion=" + formatVersion, false);
10261026
}
10271027

10281028
/**

algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public void run()
457457

458458
// Fetch settings.
459459
{
460-
JSONObject settingsJSON = this.getSettings();
460+
JSONObject settingsJSON = this.getSettings(1);
461461
settingsFile = new File(tmpDir, "settings.json");
462462
String data = settingsJSON.toString();
463463
Writer writer = new OutputStreamWriter(new FileOutputStream(settingsFile), "UTF-8");

0 commit comments

Comments
 (0)