# Sortable attributes

Child route of the settings route.

Attributes that can be used together with the sort search parameter. You can learn more about sorting in our dedicated guide.

Sortable attributes can also be updated through the global settings route.

# Get sortable attributes

GET
/indexes/:index_uid/settings/sortable-attributes

Get an index's sortableAttributes.

# Path variables

Variable Description
index_uid The index UID

# Example

# Response: 200 Ok

List the settings.

[
  "price", 
  "author"
]

# Update sortable attributes

POST
/indexes/:index_uid/settings/sortable-attributes

Update an index's sortable attributes list. This will re-index all documents in the index.

You can read more about sorting at query time on our dedicated guide.

# Path variables

Variable Description
index_uid The index UID

# Body

An array of strings containing the attributes that can be used to sort search results at query time.

You can read more about this setting at the feature reference page.

# Example

# Response: 202 Accepted

{
  "updateId": 1
}

This updateId allows you to track the current update.

# Reset sortable attributes

DELETE
/indexes/:index_uid/settings/sortable-attributes

Reset an index's sortable attributes list back to its default value.

# Default value

An empty array ([]).

# Path variables

Variable Description
index_uid The index UID

# Example

# Response: 202 Accepted

{
  "updateId": 1
}

This updateId allows you to track the current update.