Sorting
In addition to filtering, sorting can also be controlled via the filter link. Similar to the structure of the individual filter segments, a segment is appended to the URL and entered as the filter type “sort.” The value consists of the sort type and sort direction, separated by a comma.
The sorting direction is always:
- 0 = ascending (from 0 to 1)
- 1 = descending (from 1 to 0)
Example:
www.tourismus.com/listing/type=Hotel/sort=name,0
This example creates a filtered list of all hotels, sorted alphabetically by name in ascending order.
Multiple Sorting
It is also possible to combine multiple sorting criteria by using a colon (:).
The last sorting parameter in the filter link takes precedence.
Example:
www.tourismus.com/listing/type=Hotel/sort=name,0:city,1
This example creates a filtered list of all hotels, first sorted by city name in descending order, then by name in ascending order within the same city.
The sorting scheme follows this pattern:
/sort=(type of sorting),(direction of sorting)(additional sorting...)
Sorting Types
Name (name)
Sorting by name
Usage: sort=name,[0 or 1]
City (city)
Sorting by city name
Usage: sort=city,[0 or 1]
Classification (classification)
Sorting by classification
Usage: sort=classification,[0 or 1]
Length (length)
Sorting by length (e.g., for tours)
Usage: sort=length,[0 or 1]
Duration (duration)
Sorting by duration (e.g., for tours)
Usage: sort=duration,[0 or 1]
Ascent (ascent)
Sorting by elevation gain (e.g., for tours)
Usage: sort=ascent,[0 or 1]
Distance (distance)
Sorting by distance from a central point
Usage: sort=distance,[0 or 1],[latitude],[longitude]
Example: sort=distance,0,48.880829,12.575706
Additional notes:
0= from the central point outward1= from the outer area toward the central point
Sticky (sticky)
Prioritize records defined as “sticky” in the KnowledgeGraph.
Usage: sort=sticky
Additional notes:
- No sorting direction needs to be specified.
- “Top records” are marked as sticky in the KnowledgeGraph.
Random (random)
Random sorting (changes every 24 hours)
Usage: sort=random
Score (score)
Sorting with intelligent relevance scoring via our search index.
Usage: sort=score
Time (time)
Sorting by upcoming events (e.g., for event listings)
Usage: sort=time,[0 or 1]
All Sorting types
| Sort | Data field(s) | Arguments |
|---|---|---|
| city | schema:address.city | (order (String)) |
| classification | classificationMax | (order (String)) |
| deleted | deletedAt | (order (String)) |
| distance | coords | (order (String)), (lat (Lat)), (lon (Lon)) |
| geo | coords | (order (String)), (lat (Lat)), (lon (Lon)) |
| name | schema:name | (order (String)) |
| newest | creationDate, schema:datePublished | (order (String)) |
| open | snowReports.isOpen | (order (String)) |
| random | based on _id and a random hash | (order (String)) |
| score | _score (ES) | (order (String)) |
| simple | length,schema:duration,ascent | (field (String)), (order (String)) |
| sticky | sticky | / |
| time | imeline.start | (order (String)) |