Java

Settings

Get settings - getSettings

You can retrieve settings:

//Sync version
IndexSettings settings = index.getSettings());
//Async version
CompletableFuture<IndexSettings> settings = index.getSettings());

Set settings - setSettings

//Sync & Async version

index.setSettings(new IndexSettings().setCustomRanking(Arrays.asList("desc(followers)")));

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

Warning

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

Replica settings

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

//Sync & Async version

index.setSettings(new IndexSettings().setCustomRanking(Arrays.asList("desc(followers)")), true);

To add a custom setting for an index, simply extend the class IndexSettings and add your getter/setter. The new settings will be automatically serialized by jackson.

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