Attributes for Faceting
Child route of the settings route.
The attributes that can be used as facets for faceted search.
Attributes for faceting can also be updated directly through the global settings route along with the other settings.
Learn more about faceted search.
Get Attributes for Faceting
GET
/indexes/:index_uid/settings/attributes-for-faceting
Get the attributes for faceting of an index.
Path Variables
Variable | Description |
---|---|
index_uid | The index UID |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting'
client.index('movies').getAttributesForFaceting()
client.index('movies').get_attributes_for_faceting()
$client->index('movies')->getAttributesForFaceting();
index.attributes_for_faceting
client.Settings("movies").GetAttributesForFaceting()
let attributes_for_faceting: Vec<String> = movies.get_attributes_for_faceting().await.unwrap();
Response: 200 Ok
List the settings.
["genres", "director"]
Update Attributes for Faceting
POST
/indexes/:index_uid/settings/attributes-for-faceting
Update the attributes for faceting of an index.
Path Variables
Variable | Description |
---|---|
index_uid | The index UID |
Body
An array of strings that contains the attributes to use as facets.
More information about the body.
Example
curl \
-X POST 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting' \
--data '[
"genres",
"director"
]'
client.index('movies')
.updateAttributesForFaceting([
'genres',
'director'
])
client.index('movies').update_attributes_for_faceting([
'genres',
'director'
])
$client->index('movies')->updateAttributesForFaceting([
'genres',
'director'
]);
index.update_attributes_for_faceting([
'genres',
'director'
])
attributesForFaceting := []string{
"genres",
"director",
}
client.Settings("movies").UpdateAttributesForFaceting(attributesForFaceting)
let attributes_for_faceting = [
"genres",
"director"
];
let progress: Progress = movies.set_attributes_for_faceting(&attributes_for_faceting).await.unwrap();
Response: 202 Accepted
{
"updateId": 1
}
This updateId
allows you to track the current update.
Reset Attributes for Faceting
DELETE
/indexes/:index_uid/settings/attributes-for-faceting
Reset the attributes for faceting of the index to the default value.
Default value
An empty array ([]
).
Path Variables
Variable | Description |
---|---|
index_uid | The index UID |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting'
client.index('movies').resetAttributesForFaceting()
client.index('movies').reset_attributes_for_faceting()
$client->index('movies')->resetAttributesForFaceting();
index.reset_attributes_for_faceting
client.Settings("movies").ResetAttributesForFaceting()
let progress: Progress = movies.reset_attributes_for_faceting().await.unwrap();
Response: 202 Accepted
{
"updateId": 1
}
This updateId
allows you to track the current update.
当前内容版权归 meilisearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 meilisearch .