Index settings

Indexes and documents

Index settings

Configure search behavior for an index. Changes to settings are processed asynchronously and may trigger a re-index of your documents.

Not every engine applies every setting

Meilisearch applies every setting to a live index. Typesense and Elasticsearch apply a few and refuse the rest: see Settings per engine.

Get settings

GET/v1/indexes/:uid/settings

Get all settings for an index.

Auth
admin key only
Returns
200
Response
{
  "searchableAttributes": ["*"],
  "filterableAttributes": [],
  "sortableAttributes": [],
  "rankingRules": [
    "words", "typo", "proximity",
    "attribute", "sort", "exactness"
  ],
  "synonyms": {},
  "stopWords": [],
  "displayedAttributes": ["*"],
  "distinctAttribute": null,
  "typoTolerance": {
    "enabled": true,
    "minWordSizeForTypos": {
      "oneTypo": 5,
      "twoTypos": 9
    }
  },
  "faceting": {
    "maxValuesPerFacet": 100
  },
  "pagination": {
    "maxTotalHits": 1000
  }
}

Update settings

PATCH/v1/indexes/:uid/settings

Update settings for an index. Only include the settings you want to change.

Auth
admin key only
Returns
202
Request body
{
  "filterableAttributes": [
    "category",
    "price"
  ],
  "sortableAttributes": [
    "price",
    "createdAt"
  ],
  "searchableAttributes": [
    "title",
    "description"
  ]
}
Response
{
  "taskUid": 5,
  "indexUid": "products",
  "status": "enqueued"
}

Available settings

SettingTypeDescription
searchableAttributesstring[]Attributes used for search. Order determines relevance ranking.
filterableAttributesstring[]Attributes that can be used in filter expressions.
sortableAttributesstring[]Attributes that can be used in sort expressions.
rankingRulesstring[]Ordered list of ranking rules applied to search results.
synonymsobjectMap of words to their synonyms, e.g. { "phone": ["mobile", "cell"] }.
stopWordsstring[]Words ignored during search (e.g. "the", "a", "is").
displayedAttributesstring[]Attributes returned in search results. Defaults to all.
distinctAttributestring|nullDe-duplicate results by this attribute.
typoToleranceobjectConfigure typo tolerance behavior and thresholds.
facetingobjectConfigure facet behavior (e.g. maxValuesPerFacet).
paginationobjectConfigure pagination limits (e.g. maxTotalHits).
embeddersobjectConfigure vector embedders for hybrid/semantic search.

On a Visor index, searchableAttributes, filterableAttributes, sortableAttributes, displayedAttributes, rankingRules (built-in and custom rules, whose attribute must be sortable), synonyms, stopWords, typoTolerance, pagination and faceting (maxValuesPerFacet, with facet values most frequent first) apply to the live index. Visor refuses distinctAttribute, embedders, proximityPrecision, searchCutoffMs and the token settings with 400 feature_not_supported, so a setting never looks applied when it is not. Sending null for one of them is accepted and changes nothing.

Settings per engine

EngineApplies to a live indexAnything else
MeilisearchEvery setting above.Nothing is refused.
Typesensesynonyms, searchableAttributes, filterableAttributes, sortableAttributes, displayedAttributes, typoTolerance and rankingRules. The filterable and sortable lists only turn fields on, which is what facets and sorting a string field need. A field can be made sortable only once a document has given it a type: before that the call answers 409 settings_need_documents. Typo settings and custom ranking rules apply to every search through /v1. A custom rule such as popularity:desc sorts searches that send no sort of their own, as a tie-break after the text match.Answers 400 unsupported_setting. That covers stop words, which are server-wide on Typesense, typoTolerance.disableOnWords, built-in ranking rules out of their default order, and more than two custom rules.
ElasticsearchsearchableAttributes (each field boosted by its place), displayedAttributes, rankingRules (custom rules sort results with equal scores), typoTolerance.enabled, distinctAttribute and faceting. On a newer index, synonyms and stopWords too, through the index's own synonym set, with no reindex. It filters and sorts on any field without a list (a string field through field.keyword).A setting that would change the index answers 400 unsupported_setting: the filterable and sortable lists, built-in ranking rules out of their default order, and synonyms or stop words on an index created before they came to Elasticsearch.

Sending back the settings you read never fails. See Engine compatibility.