Settings API client methods
This is documentation for v3 of the PHP API clients, which is not the latest version. To see the documentation for the latest version, see PHP v4.
This is documentation for v2 of the Ruby API clients, which is not the latest version. To see the documentation for the latest version, see Ruby v3.
This is documentation for v4 of the JavaScript API clients, which is not the latest version. To see the documentation for the latest version, see JavaScript v5.
This is documentation for v3 of the Python API clients, which is not the latest version. To see the documentation for the latest version, see Python v4.
This is documentation for v8 of the Swift API clients, which is not the latest version. To see the documentation for the latest version, see Swift v9.
This is documentation for v2 of the Kotlin API clients, which is not the latest version. To see the documentation for the latest version, see Kotlin v3.
This is documentation for v6 of the C# API clients, which is not the latest version. To see the documentation for the latest version, see C# v7.
This is documentation for v3 of the Java API clients, which is not the latest version. To see the documentation for the latest version, see Java v4.
This is documentation for v3 of the Go API clients, which is not the latest version. To see the documentation for the latest version, see Go v4.
This is documentation for v1 of the Scala API clients, which is not the latest version. To see the documentation for the latest version, see Scala v2.
Get settings |
Retrieve index settings. |
Set settings |
Change an index’s settings. |
Copy settings |
Copy the settings of an index to another index on the same app. |
The scope of settings (and parameters)
You can add settings when configuring an index, or when performing a search query. In both cases, settings are sent to Algolia using parameters.
- When adding settings to an index, use the
setSettings
method. - When adding settings to a search query, add the settings as parameters to the
search
method.
Each parameter has a scope:
Scope: settings
Parameters with scope settings
can only be configured on an index with the setSettings
method.
They’re not available as search parameters.
Index settings are built directly into your index and they impact every search.
Scope: search
Individual queries can be parameterized by adding search parameters to the search
method.
These parameters affect only those queries that use them; they don’t set any index defaults.
Scope: settings
and search
When applying both, you set an index default with the setSettings
method.
These settings are then overridden by the parameters you add to your search
method.
You can override only some settings. Check each settings’ reference documentation to see its scope.
If you don’t apply an index setting or search parameter, Algolia applies an engine-level default.
Example
In this example, all queries performed on this index use a queryType
of prefixLast
:
1
2
3
4
5
index.setSettings({
queryType: 'prefixLast'
}).then(() => {
// done
});
Now, every query applies a prefixLast
logic.
You can override this at search time.
For example, the next query overrides that index setting with prefixAll
:
1
2
3
4
5
index.search('query', {
queryType: 'prefixAll'
}).then(() => {
// done
});
Settings categories
To help you navigate the list of settings, they can be grouped into the following categories: