Skip to main content
This page documents an earlier version of the API client. For the latest version, see Create or update rules.
Required ACL: editSettings This method, like replaceAllObjects, guarantees zero downtime. All existing rules are deleted and replaced with the new ones, in a single, atomic operation.

Examples

SearchClient client = new SearchClient("YourApplicationID", "YourWriteAPIKey");
SearchIndex index = client.InitIndex("your_index_name");

List<Rule> rules = /* Fetch your rules */

index.ReplaceAllRules(rules);

// Or if you want to also replace synonyms on replicas
index.ReplaceAllRules(synonyms, forwardToReplicas: true);

// Asynchronous
await index.ReplaceAllRulesAsync(synonyms, forwardToReplicas: true);

Parameters

rules
list
required
See the rule parameter of the saveRule method.
forwardToReplicas
boolean
default:false
Whether to also replace all rules on replicas.
requestOptions
object
A mapping of request options to send along with the request.
I