Android

Settings

Get settings - getSettingsAsync

You can retrieve settings:

index.getSettingsAsync(new CompletionHandler() {
    @Override
    public void requestCompleted(JSONObject content, AlgoliaException error) {
        // [...]
    }
});

Set settings - setSettingsAsync

index.setSettingsAsync(new JSONObject().append("customRanking", "desc(followers)"), null);

You can find the list of parameters you can set in the Settings Parameters section

Warning

Performance wise, it’s better to do a setSettingsAsync before pushing the data

Replica settings

You can forward all settings updates to the replicas of an index by using the forwardToReplicas option:

JSONObject settings = new JSONObject("{\"attributesToRetrieve\": [\"name\", \"birthdate\"]}");
JSONObject setSettingsResult = index.setSettings(settings, true);
index.waitTask(setSettingsResult.getString("taskID"));

Index settings parameters

Here is the list of parameters you can use with the set settings method (settings scope).

Parameters that can be overridden at search time also have the search scope.

Attributes

Ranking

Filtering / Faceting

Highlighting / Snippeting

Pagination

Typos

Query Strategy

Performance

Advanced