Skip to content

Commit

Permalink
update sort docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Oct 25, 2024
1 parent c65a4d0 commit b315c98
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions trove/vocab/trove.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,17 +656,21 @@ def trove_browse_link(iri: str):
RDFS.comment: {literal('how to order search results', language='en')},
TROVE.jsonSchema: {literal_json({'type': 'string'})},
DCTERMS.description: {_literal_markdown(f'''**sort** is
a query param to control ordering of search results
a query param to control ordering of search results based on values of a specific type at a specific path.
accepts a short-hand iri for a date property:
to sort by date values, use `sort` (or `sort[date-value]`) with a **property-path** that ends with
one of the following supported date properties:
{", ".join(f"`{osfmap_shorthand().compact_iri(_date_iri)}`" for _date_iri in DATE_PROPERTIES)}
prefix with `-` to sort descending (latest first), otherwise sorts ascending (earliest first)
to sort by integer values, use `sort[integer-value]` with a **property-path** to the integers of interest.
if missing (or if `sort=-relevance`), results are sorted by some notion of
by default, sorts "ascending" (beginning with earliest date or smallest integer) --
prefix the value with `-` to sort "descending" (beginning with latest date or largest integer).
if missing (or with value `-relevance`), results are sorted by some notion of
relevance to the request's search-text or (if no search-text) by random.
may not be used with `page[cursor]`
may not be used with `page[cursor]`.
''', language='en')},
},

Expand Down

0 comments on commit b315c98

Please sign in to comment.