# SortFlags

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SortFlags/

Sort flags.

- **Full name:** `MFiles.SortFlags`
- **Proto file:** [`mfiles/enums.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/enums.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-all"></a>`all` | `bool` | 1 | Specifies all flags set; Including any future flags. |
| <a id="f-allow_resorting_to_default_sort"></a>`allow_resorting_to_default_sort` | `bool` | 2 | Allows resorting to default sorting if the specified sorting is not supported. If this flag is not present, an unsupported sort request causes an error. |

<a id="used-in-fields"></a>

## Used in fields

- [`SearchResultsSorting.options`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchResultsSorting/index.md#f-options): Sort flags. Set `allow_resorting_to_default_sort` to get relevance order instead of an error when the rule cannot be applied.
