Csharp

Settings

Get settings - GetSettings

You can retrieve settings:

var res = index.GetSettings();
// Asynchronous
// var res = await index.GetSettingsAsync();
System.Diagnostics.Debug.WriteLine(res);

Set settings - SetSettings

index.SetSettings(JObject.Parse(@"{""customRanking"":[""desc(followers)""]}"));
// Asynchronous
await index.SetSettingsAsync(JObject.Parse(@"{""customRanking"":[""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:

index.SetSettings(JObject.Parse(@"{""customRanking"":[""desc(followers)""]}"), true);
// Asynchronous
await index.SetSettingsAsync(JObject.Parse(@"{""customRanking"":[""desc(followers)""]}"), true);

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