# Distinct attribute

Child route of the settings route.

Distinct attribute is a field whose value will always be unique in the returned documents.

Distinct attribute can also be updated directly through the global settings route along with the other settings.

NOTE

Updating the settings means overwriting the default settings of MeiliSearch. You can reset to default values using the DELETE routes.

Learn more about distinct attribute.

# Get distinct attribute

GET
/indexes/:index_uid/settings/distinct-attribute

Get the distinct attribute field of an index.

# Path Variables

Variable Description
index_uid The index UID

# Example

# Response: 200 Ok

"movie_id"

# Update distinct attribute

POST
/indexes/:index_uid/settings/distinct-attribute

Update the distinct attribute field of an index.

# Path Variables

Variable Description
index_uid The index UID

# Body

A String: the field name.

More information about the body.

# Example

# Response: 202 Accepted

{
  "updateId": 1
}

This updateId allows you to track the current update.

# Reset distinct attribute

DELETE
/indexes/:index_uid/settings/distinct-attribute

Reset the distinct attribute field of an index to its default value.

Default value: null

# Path Variables

Variable Description
index_uid The index UID

# Example

# Response: 202 Accepted

{
  "updateId": 1
}

This updateId allows you to track the current update.

Last Updated: 11/10/2020, 3:09:11 PM