# Sorting

It is possible sort the result of any search. The following type of sorting are supported:

* ASCENDING (ascending order,  case - or database sensitive)
* ASCENDING INSENSITIVE (ascending order, case-insensitive)
* DESCENDING (descending order, case - or database - sensitive)
* DESCENDING INSENSITIVE (descending order, case-insensitive)

ASCENDING

<http://localhost:8080/ws/rest/Vessel?sort=vesselName(AS)>

ASCENDING INSENSITIVE

<http://localhost:8080/ws/rest/Vessel?sort=vesselName(ASI)>

DESCENDING&#x20;

<http://localhost:8080/ws/rest/Vessel?sort=vesselName(DS)>

DESCENDING INSENSITIVE

<http://localhost:8080/ws/rest/Vessel?sort=vesselName(DSI>)

&#x20;

It is possible use sorting in combination with any filter and pagination:

<http://localhost:8080/ws/rest/Vessel?sort=vesselName(DSI)&filter=flag.countryCode(EQ)HK&pageNumber=4&limit=10>\
\
Calculated fields are sorted after data retrieval and only consider records in the response. See the data model documentation for field specifications: <https://dataloy-systems.stoplight.io/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.dataloy.com/api-release-8.25/dataloy-rest-api/sorting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
