This specification describes the filterableAttributes index setting API endpoints.
N/A
filterableAttributes setting allows to configure the document fields usable as filter criteria and as facets.
Filters have several use-cases, such as restricting the results a specific user has access to or creating faceted search interfaces. Faceted search interfaces are particularly efficient in helping users navigate a great number of results across many broad categories.
filterableAttributes need to be properly processed and prepared by Meilisearch before they can be used at search time. Fields defined as filterableAttributes are usable in the filter and facets search API parameters.
By default, Meilisearch has no filterable attributes defined.
filterableAttributes is a sub-resource of /indexes/:index_uid/settings.
See Settings API.
Manipulate the filterableAttributes setting of a Meilisearch index.
Fetch the filterableAttributes setting of a Meilisearch index.
- Type: Array of String
- Default:
[]
- 🔴 Sending an invalid index uid format for the
:index_uidpath parameter returns an invalid_index_uid error. - 🔴 If the requested
index_uiddoes not exist, the API returns an index_not_found error.
Modify the filterableAttributes setting of a Meilisearch index.
- Type: Array of String /
null
Setting null is equivalent to using the 3.3.3. DELETE - indexes/:index_uid/settings/filterable-attributes API endpoint.
Specifying a document attribute that does not exist as a filterableAttributes index setting returns no error.
When the request is successful, Meilisearch returns the HTTP code 202 Accepted. The response's content is the summarized representation of the received asynchronous task.
See Summarized task Object for 202 Accepted.
- 🔴 Omitting Content-Type header returns a missing_content_type error.
- 🔴 Sending an empty Content-Type returns an invalid_content_type error.
- 🔴 Sending a different Content-Type than
application/jsonreturns an invalid_content_type error. - 🔴 Sending an empty payload returns a missing_payload error.
- 🔴 Sending an invalid JSON payload returns a malformed_payload error.
- 🔴 Sending an invalid index uid format for the
:index_uidpath parameter returns an invalid_index_uid error. - 🔴 Sending a request payload value type different of
Array of String,[], ornullreturns an invalid_settings_filterable_attributes error.
- 🔴 When Meilisearch is secured, if the API Key do not have the
indexes.createaction defined, the API returns an index_not_found error in the related asynchronoustaskresource. See 3.3.2.2. Response Definition.
Otherwise, Meilisearch will create the index in a lazy way. See 3.2.2.4. Lazy Index Creation.
If the requested index_uid does not exist, and the authorization layer allows it (See 3.3.2.3.1. Async Errors), Meilisearch will create the index when the related asynchronous task resource is executed. See 3.3.2.2. Response Definition.
Reset the filterableAttributes setting of a Meilisearch index to the default value [].
When the request is in a successful state, Meilisearch returns the HTTP code 202 Accepted. The response's content is the summarized representation of the received asynchronous task.
See Summarized task Object for 202 Accepted.
- 🔴 Sending an invalid index uid format for the
:index_uidpath parameter returns an invalid_index_uid error.
- 🔴 If the requested
index_uiddoes not exist, the API returns an index_not_found error in the related asynctaskresource. See 3.3.3.1. Response Definition.
These errors apply to all endpoints described here.
The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).
- 🔴 Accessing this route without the
Authorizationheader returns a missing_authorization_header error. - 🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an invalid_api_key error.
Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.
Modifying this index setting cause documents to be re-indexed.
n/a