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

On Meilisearch every setting below applies to a live index. Typesense accepts synonyms, searchableAttributes, filterableAttributes and sortableAttributes, and answers any other setting with 400 unsupported_setting. On Typesense 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. Elasticsearch applies typoTolerance.enabled, distinctAttribute and faceting, and answers any other setting that would change the index with 400 unsupported_setting: it searches every field, and filters and sorts on any field without a list (a string field through field.keyword). Sending back the settings you read never fails. See Engine Compatibility.

GET/v1/indexes/:uid/settings

Get all settings for an index.

Auth admin key onlyReturns 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
  }
}
PATCH/v1/indexes/:uid/settings

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

Auth admin key onlyReturns 202
Request body
{
  "filterableAttributes": ["category", "price"],
  "sortableAttributes": ["price", "createdAt"],
  "searchableAttributes": ["title", "description"]
}
Response
{
  "taskUid": 5,
  "indexUid": "products",
  "status": "enqueued"
}
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 (the built-in rules only), synonyms, stopWords and typoTolerance apply to the live index. Visor refuses distinctAttribute, faceting, pagination, 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.