Api clients
/
Swift
/
V7
/
Methods
Jan 16, 2025
Replace All Rules | iOS API Client V7 (Deprecated)
Deprecated content
This documentation is for a deprecated version of iOS API client.
Some features and settings may be missing or their usage may have changed.
Refer to the documentation for the
latest version of iOS API client for up-to-date information.
Required API Key: any key with the
editSettings
ACL
Method signature
Not implemented yet.
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.
Examples
Replace all rules
Copy
1
2
3
4
5
6
7
8
9
10
11
12
$client = Algolia\AlgoliaSearch\SearchClient::create(
'YourApplicationID',
'YourWriteAPIKey'
);
$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]);
Parameters
rules
|
type: list
Required
See rule. |
forwardToReplicas
|
type: boolean
default: false
Optional
Also replace rules on replicas |
requestOptions
|
type: key/value mapping
default: No request options
Optional
A mapping of [`requestOptions`](/doc/api-client/getting-started/request-options/) to send along with the request. |
Response
No response.
Did you find this page helpful?