Sorting

Sorting in SearchBlox

SearchBlox allows you to sort search results by multiple fields at the same time using multisort.

Default Sort

  • The URL parameter sort is set by default to mrank, which can be seen in the Search tab of the dashboard. The default sorting direction is ascending (asc).
  • sort and sortdir are always active even if they are not included in the URL. Their default values are mrank and asc unless changed.
  • sort1 and sortdir1 have default values relevance and desc unless specified otherwise.

Multisort

  • SearchBlox supports custom search fields, which can be text, number, or date. In WEB and Custom Collections, these fields must first be added and their data types defined in mapping.json.
  • The custom sort parameters are sort1, sort2, and sort3. The priority order is sort > sort1 > sort2 > sort3, where sort always has the highest priority.

Priority in Sorting

  • Later sort parameters are applied only if the previous ones produce the same results.
  • For example, sort3 is used only if sort, sort1, and sort2 all return the same results.