Skip to main content
This page documents an earlier version of the API client. For the latest version, see Update index settings.
Required ACL: editSettings Only specified settings are overridden. Unspecified settings are left unchanged. Specifying null for a setting resets it to its default value. For a list of available settings, see Index settings. For best performance, change the settings before you add records to your index.

Examples

Set settings

IndexSettings settings = new IndexSettings
{
  SearchableAttributes = new List<string> { "name", "address" },
  CustomRanking = new List<string> { "desc(followers)" }
};

index.SetSettings(settings);

// Asynchronous
await index.SetSettingsAsync(settings);

Set settings and forward to replicas

IndexSettings settings = new IndexSettings
{
  SearchableAttributes = new List<string> { "name", "adress" },
  CustomRanking = new List<string> { "desc(followers)" }
};

index.SetSettings(settings, forwardToReplicas: true);

// Asynchronous
await index.SetSettingsAsync(settings, forwardToReplicas: true);

Parameters

settings
object
required
A mapping of settings parameters you can use on an index.
forwardToReplicas
boolean
default:false
Whether to forward the same settings to the replica indices.Note: when forwarding settings, please make sure your replicas already exist. It’s impossible to forward settings and create your replicas at the same time.
requestOptions
object
A mapping of additional request options, such as timeouts or headers.

Response

taskID
integer
The task ID used with the waitTask method.
updatedAt
string
Date at which the indexing job has been created.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "updatedAt":"2013-01-18T15:33:13.556Z",
  "taskID": 678
}
I