Filterable attributes

    Attributes that can be used as filters for filtering and faceted search. You can learn more about filtering and faceted search in our dedicated guide.

    Filterable attributes can also be updated through the .

    GET

    Get an index’s filterableAttributes.

    Example

    cURL

    JavaScript

    Python

    PHP

    Ruby

    Go

    Rust

    1. curl \
    2. -X GET 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
    1. client.index('movies').getFilterableAttributes()
    1. client.index('movies').get_filterable_attributes()
    1. $client->index('movies')->getFilterableAttributes();
    1. client.index('movies').filterable_attributes
    1. client.Index("movies").GetFilterableAttributes()
    1. let filterable_attributes: Vec<String> = movies.get_filterable_attributes().await.unwrap();

    Response: 200 Ok

    1. ["genres", "director"]

    POST

    Update an index’s . This will re-index all documents in the index.

    Body

    An array of strings containing the attributes that can be used as filters at query time.

    cURL

    JavaScript

    Python

    PHP

    Ruby

    Go

    Rust

    1. -X POST 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
    2. --data '[
    3. "genres",
    4. "director"
    5. ]'
    1. client.index('movies')
    2. .updateFilterableAttributes([
    3. 'director'
    4. ])
    1. client.index('movies').update_filterable_attributes([
    2. 'genres',
    3. 'director'
    4. ])
    1. $client->index('movies')->updateFilterableAttributes([
    2. 'genres',
    3. 'director'
    4. ]);
    1. client.index('movies').update_filterable_attributes([
    2. 'genres',
    3. 'director'
    4. ])
    1. filterableAttributes := []string{
    2. "director",
    3. }
    4. client.Index("movies").UpdateFilterableAttributes(&filterableAttributes)
    1. let filterable_attributes = [
    2. "genres",
    3. ];
    4. let progress: Progress = movies.set_filterable_attributes(&filterable_attributes).await.unwrap();

    Response: 202 Accepted

    1. {
    2. "updateId": 1
    3. }

    DELETE

    Reset an index’s back to its default value.

    Default value

    An empty array ([]).

    Example

    cURL

    JavaScript

    Python

    PHP

    Ruby

    Go

    Rust

    1. curl \
    2. -X DELETE 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
    1. client.index('movies').resetFilterableAttributes()
    1. client.index('movies').reset_filterable_attributes()
    1. $client->index('movies')->resetFilterableAttributes();
    1. client.index('movies').reset_filterable_attributes
    1. client.Index("movies").ResetFilterableAttributes()
    1. let progress: Progress = movies.reset_filterable_attributes().await.unwrap();

    Response: 202 Accepted

    1. {
    2. "updateId": 1
    3. }

    This allows you to .