# Sort Clause reference

> For the complete documentation index, see [llms.txt](https://doc.ibexa.co/en/5.0/llms.txt).

Sort Clauses help fine-tune sorting order when searching for content and locations.

Sort Clauses are the sorting options for Content and Location Search and [Repository filtering](https://doc.ibexa.co/en/5.0/search/search_api/#repository-filtering).

Capabilities of individual Sort Clauses can depend on the search engine.

All Sort Clauses can take the following optional argument:

- `sortDirection` - the direction of the sorting, either `Query::SORT_ASC` (default) or `Query::SORT_DESC`

## Sort Clauses

| Sort Clause                                                                                                                  | Sorting based on                                                                            | Content Search | Location Search | Filtering | Trash |
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------- | --------------- | --------- | ----- |
| [ContentId](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/contentid_sort_clause/index.md)                         | Content items' ID                                                                           | Yes            | Yes             | Yes       |       |
| [ContentName](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/contentname_sort_clause/index.md)                     | Content names                                                                               | Yes            | Yes             | Yes       | Yes   |
| [ContentTranslatedName](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/contenttranslatedname_sort_clause/index.md) | Translated content names                                                                    | Yes            | Yes             |           |       |
| [ContentTypeName](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/contenttypename_sort_clause/index.md)             | Content items' content type name                                                            |                |                 |           | Yes   |
| [CustomField](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/customfield_sort_clause/index.md)                     | Raw search index fields                                                                     | Yes            | Yes             |           |       |
| [DateModified](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/datemodified_sort_clause/index.md)                   | The date when content was last modified                                                     | Yes            | Yes             | Yes       |       |
| [DatePublished](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/datepublished_sort_clause/index.md)                 | The date when content was created                                                           | Yes            | Yes             | Yes       |       |
| [DateTrashed](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/datetrashed_sort_clause/index.md)                     | The date when content was sent to trash                                                     |                |                 |           | Yes   |
| [Depth](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/depth_sort_clause/index.md)                                 | Location depth in the content tree                                                          |                | Yes             | Yes       | Yes   |
| [Field](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/field_sort_clause/index.md)                                 | Content of one of content item's fields                                                     | Yes            | Yes             |           |       |
| [Id](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/id_sort_clause/index.md)                                       | Location ID                                                                                 |                | Yes             | Yes       |       |
| [IsMainLocation](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/ismainlocation_sort_clause/index.md)               | Whether a location is the main location of a content item                                   |                | Yes             |           |       |
| [MapLocationDistance](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/maplocationdistance_sort_clause/index.md)     | Distance between the location contained in a MapLocation field and the provided coordinates | Yes            | Yes             |           |       |
| [Path](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/path_sort_clause/index.md)                                   | PathString of the Location                                                                  |                | Yes             | Yes       | Yes   |
| [Priority](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/priority_sort_clause/index.md)                           | Location priority                                                                           |                | Yes             | Yes       | Yes   |
| [Random](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/random_sort_clause/index.md)                               | Random seed                                                                                 | Yes            | Yes             |           |       |
| [Score](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/score_sort_clause/index.md)                                 | Score of the search result                                                                  | Yes            | Yes             |           |       |
| [SectionIdentifier](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/sectionidentifier_sort_clause/index.md)         | ID of the Section content is assigned to                                                    | Yes            | Yes             | Yes       |       |
| [SectionName](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/sectionname_sort_clause/index.md)                     | Name of the Section content is assigned to                                                  | Yes            | Yes             | Yes       | Yes   |
| [UserLogin](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/userlogin_sort_clause/index.md)                         | Login of the content item's creator                                                         |                |                 |           | Yes   |
| [Visibility](https://doc.ibexa.co/en/5.0/search/sort_clause_reference/visibility_sort_clause/index.md)                       | Whether the location is visible or not                                                      |                | Yes             | Yes       |       |
