Sorting parameters provided with a Search request. Sorting allows you to control how results to your query are sorted. If no sorting is specified, the results are sorted by relevance in descending (desc) order.

interface SearchSorting {
    field: string;
    fieldType?: string;
    filter?: _SearchQueryExpression;
    language?: string;
    mode?: string;
    order: string;
}

Properties

field: string

Use any searchable field of the resource as sort criterion.

fieldType?: string

Provide the data type of the given field.

Allows you to apply a sort filter.

language?: string

String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example: en, en-US, zh-Hans-SG.

mode?: string

Specify the sort mode to be applied for a set-type field.

order: string

Specify the order in which the search results should be sorted. Can be asc for ascending, or desc for descending order.