Skip to main content

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.

info

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 outward
  • 1 = 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

SortData field(s)Arguments
cityschema:address.city(order (String))
classificationclassificationMax(order (String))
deleteddeletedAt(order (String))
distancecoords(order (String)), (lat (Lat)), (lon (Lon))
geocoords(order (String)), (lat (Lat)), (lon (Lon))
nameschema:name(order (String))
newestcreationDate,
schema:datePublished
(order (String))
opensnowReports.isOpen(order (String))
randombased on _id and a random hash(order (String))
score_score (ES)(order (String))
simplelength,schema:duration,ascent(field (String)), (order (String))
stickysticky/
timeimeline.start(order (String))