Skip to content

Settings API

Retrieve the current settings for an index.

GET /1/indexes/{indexName}/settings
{
"searchableAttributes": ["title", "description"],
"attributesForFaceting": ["genre", "year"],
"ranking": [
"typo",
"geo",
"words",
"filters",
"proximity",
"attribute",
"exact",
"custom"
],
"customRanking": ["desc(popularity)"],
"hitsPerPage": 20,
"highlightPreTag": "<em>",
"highlightPostTag": "</em>"
}
Terminal window
curl 'http://localhost:7700/1/indexes/movies/settings' \
-H 'X-Algolia-Application-Id: flapjack' \
-H 'X-Algolia-API-Key: YOUR_ADMIN_KEY'

Change the settings for an index. Settings not specified in the request remain unchanged.

PUT /1/indexes/{indexName}/settings
{
"searchableAttributes": ["title", "description", "tags"],
"attributesForFaceting": ["genre", "year", "rating"],
"customRanking": ["desc(popularity)", "asc(title)"],
"hitsPerPage": 10
}
SettingTypeDescription
searchableAttributesstring[]Attributes used for text search, in order of priority
attributesToRetrievestring[]Default attributes to include in search results
unretrievableAttributesstring[]Attributes that can be used for search but won’t be returned
SettingTypeDescription
attributesForFacetingstring[]Attributes available for faceted search
maxFacetHitsintegerMax number of facet values returned per facet
sortFacetValuesBystring"count" or "alpha"
SettingTypeDescription
rankingstring[]Ordered list of ranking criteria
customRankingstring[]Custom attributes for ranking (e.g., "desc(popularity)")
SettingTypeDescription
attributesToHighlightstring[]Attributes to highlight by default
attributesToSnippetstring[]Attributes to snippet (e.g., "description:50")
highlightPreTagstringOpening tag for highlights (default: "<em>")
highlightPostTagstringClosing tag for highlights (default: "</em>")
SettingTypeDescription
hitsPerPageintegerDefault results per page (default: 20, max: 1000)
paginationLimitedTointegerMaximum number of retrievable hits (default: 1000)
{
"taskID": 12345,
"updatedAt": "2026-01-15T10:00:00Z"
}
Terminal window
curl -X PUT 'http://localhost:7700/1/indexes/movies/settings' \
-H 'X-Algolia-Application-Id: flapjack' \
-H 'X-Algolia-API-Key: YOUR_ADMIN_KEY' \
-H 'Content-Type: application/json' \
-d '{
"searchableAttributes": ["title", "description"],
"attributesForFaceting": ["genre", "year"],
"customRanking": ["desc(popularity)"]
}'