Skip to content

Commit a936b79

Browse files
authored
feat(search): sortProperties on searchRequest
Adds `sortProperties` to searchRequest, following the MS Graph sortProperty resource type: an ordered list of {name, isDescending} entries; results are sorted by relevance when absent. Sortable are the scalar properties carried on the search hit's resource (name, size, lastModifiedDateTime, mimeType and scalar facet properties such as photo.takenDateTime or audio.artist). Strings sort lexicographically, numbers and dates by value. Multivalued and unknown properties are rejected with invalidRequest.
1 parent 12d8885 commit a936b79

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

api/openapi-spec/v1.0.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6505,6 +6505,41 @@ components:
65056505
results in a logical AND between the filters.
65066506
items:
65076507
type: string
6508+
sortProperties:
6509+
type: array
6510+
description: |
6511+
Contains the ordered collection of fields to sort the results on.
6512+
If absent, the results are sorted by relevance. See
6513+
`sortProperty.name` for the set of sortable fields. Optional.
6514+
items:
6515+
$ref: '#/components/schemas/sortProperty'
6516+
sortProperty:
6517+
type: object
6518+
description: |
6519+
Indicates the order to sort search results in. Follows the
6520+
[MS Graph sortProperty](https://learn.microsoft.com/en-us/graph/api/resources/sortproperty)
6521+
resource type.
6522+
required:
6523+
- name
6524+
properties:
6525+
name:
6526+
type: string
6527+
description: |
6528+
The name of the property to sort the search results by. Required.
6529+
6530+
Sortable are the scalar properties carried on the search hit's
6531+
resource: `name`, `size`, `lastModifiedDateTime`, `mimeType` and
6532+
the scalar facet properties such as `photo.takenDateTime`,
6533+
`photo.iso`, `audio.artist`, `audio.year` or `image.width`.
6534+
Strings sort lexicographically, numbers and dates by value.
6535+
Multivalued properties (e.g. `tags`) and unknown properties are
6536+
rejected with `invalidRequest`.
6537+
isDescending:
6538+
type: boolean
6539+
description: |
6540+
Set to `true` to sort the results in descending order. Optional,
6541+
defaults to `false` (ascending).
6542+
default: false
65086543
searchQuery:
65096544
type: object
65106545
description: |

0 commit comments

Comments
 (0)