Skip to content

Commit c400b39

Browse files
committed
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 d0dceba commit c400b39

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
@@ -5962,6 +5962,41 @@ components:
59625962
results in a logical AND between the filters.
59635963
items:
59645964
type: string
5965+
sortProperties:
5966+
type: array
5967+
description: |
5968+
Contains the ordered collection of fields to sort the results on.
5969+
If absent, the results are sorted by relevance. See
5970+
`sortProperty.name` for the set of sortable fields. Optional.
5971+
items:
5972+
$ref: '#/components/schemas/sortProperty'
5973+
sortProperty:
5974+
type: object
5975+
description: |
5976+
Indicates the order to sort search results in. Follows the
5977+
[MS Graph sortProperty](https://learn.microsoft.com/en-us/graph/api/resources/sortproperty)
5978+
resource type.
5979+
required:
5980+
- name
5981+
properties:
5982+
name:
5983+
type: string
5984+
description: |
5985+
The name of the property to sort the search results by. Required.
5986+
5987+
Sortable are the scalar properties carried on the search hit's
5988+
resource: `name`, `size`, `lastModifiedDateTime`, `mimeType` and
5989+
the scalar facet properties such as `photo.takenDateTime`,
5990+
`photo.iso`, `audio.artist`, `audio.year` or `image.width`.
5991+
Strings sort lexicographically, numbers and dates by value.
5992+
Multivalued properties (e.g. `tags`) and unknown properties are
5993+
rejected with `invalidRequest`.
5994+
isDescending:
5995+
type: boolean
5996+
description: |
5997+
Set to `true` to sort the results in descending order. Optional,
5998+
defaults to `false` (ascending).
5999+
default: false
59656000
searchQuery:
59666001
type: object
59676002
description: |

0 commit comments

Comments
 (0)