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

  1. /indexes/:index_uid/settings/attributes-for-faceting

Get the attributes for faceting of an index.

Path Variables

VariableDescription
index_uidThe index UID

Example

  1. curl \
  2. -X GET 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting'
  1. client.index('movies').getAttributesForFaceting()
  1. client.index('movies').get_attributes_for_faceting()
  1. $client->index('movies')->getAttributesForFaceting();
  1. index.attributes_for_faceting
  1. client.Settings("movies").GetAttributesForFaceting()
  1. let attributes_for_faceting: Vec<String> = movies.get_attributes_for_faceting().await.unwrap();

Response: 200 Ok

List the settings.

  1. ["genres", "director"]

Update Attributes for Faceting

POST

  1. /indexes/:index_uid/settings/attributes-for-faceting

Update the attributes for faceting of an index.

Path Variables

VariableDescription
index_uidThe index UID

Body

An array of strings that contains the attributes to use as facets.

More information about the body.

Example

  1. curl \
  2. -X POST 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting' \
  3. --data '[
  4. "genres",
  5. "director"
  6. ]'
  1. client.index('movies')
  2. .updateAttributesForFaceting([
  3. 'genres',
  4. 'director'
  5. ])
  1. client.index('movies').update_attributes_for_faceting([
  2. 'genres',
  3. 'director'
  4. ])
  1. $client->index('movies')->updateAttributesForFaceting([
  2. 'genres',
  3. 'director'
  4. ]);
  1. index.update_attributes_for_faceting([
  2. 'genres',
  3. 'director'
  4. ])
  1. attributesForFaceting := []string{
  2. "genres",
  3. "director",
  4. }
  5. client.Settings("movies").UpdateAttributesForFaceting(attributesForFaceting)
  1. let attributes_for_faceting = [
  2. "genres",
  3. "director"
  4. ];
  5. let progress: Progress = movies.set_attributes_for_faceting(&attributes_for_faceting).await.unwrap();

Response: 202 Accepted

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

This updateId allows you to track the current update.

Reset Attributes for Faceting

DELETE

  1. /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

VariableDescription
index_uidThe index UID

Example

  1. curl \
  2. -X DELETE 'http://localhost:7700/indexes/movies/settings/attributes-for-faceting'
  1. client.index('movies').resetAttributesForFaceting()
  1. client.index('movies').reset_attributes_for_faceting()
  1. $client->index('movies')->resetAttributesForFaceting();
  1. index.reset_attributes_for_faceting
  1. client.Settings("movies").ResetAttributesForFaceting()
  1. let progress: Progress = movies.reset_attributes_for_faceting().await.unwrap();

Response: 202 Accepted

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

This updateId allows you to track the current update.