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
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
client.index('movies').getFilterableAttributes()
client.index('movies').get_filterable_attributes()
$client->index('movies')->getFilterableAttributes();
client.index('movies').filterable_attributes
client.Index("movies").GetFilterableAttributes()
let filterable_attributes: Vec<String> = movies.get_filterable_attributes().await.unwrap();
Response: 200 Ok
["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
-X POST 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
--data '[
"genres",
"director"
]'
client.index('movies')
.updateFilterableAttributes([
'director'
])
client.index('movies').update_filterable_attributes([
'genres',
'director'
])
$client->index('movies')->updateFilterableAttributes([
'genres',
'director'
]);
client.index('movies').update_filterable_attributes([
'genres',
'director'
])
filterableAttributes := []string{
"director",
}
client.Index("movies").UpdateFilterableAttributes(&filterableAttributes)
let filterable_attributes = [
"genres",
];
let progress: Progress = movies.set_filterable_attributes(&filterable_attributes).await.unwrap();
Response: 202 Accepted
{
"updateId": 1
}
DELETE
Reset an index’s back to its default value.
Default value
An empty array ([]
).
Example
cURL
JavaScript
Python
PHP
Ruby
Go
Rust
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
client.index('movies').resetFilterableAttributes()
client.index('movies').reset_filterable_attributes()
$client->index('movies')->resetFilterableAttributes();
client.index('movies').reset_filterable_attributes
client.Index("movies").ResetFilterableAttributes()
let progress: Progress = movies.reset_filterable_attributes().await.unwrap();
Response: 202 Accepted
{
"updateId": 1
}
This allows you to .