Replace All Rules
About this method
Push a new set of rules and erase all previous ones.
This method, like
replaceAllObjects, guarantees zero downtime.
All existing rules are deleted and replaced with the new ones, in a single, atomic operation.
Replace all rules
1 2 3 4 5 6 7 8 9 10 11 12 $client = Algolia\AlgoliaSearch\SearchClient::create( 'YourApplicationID', 'YourAdminAPIKey' ); $rules = /* Fetch your rules */; $index = $client->initIndex('your_index_name'); $index->replaceAllRules($rules); // Or if you want to also replace rules on replicas $index->replaceAllRules($rules, ['forwardToReplicas' => true]);