Custom sort criteria example - Fluid Topics - Latest

Fluid Topics Configuration and Administration Guide

Category
Reference Guides
Audience
public
Version
Latest

For this example, the following document and topics are available on the portal:

Fluid Topics release notes
├── Fluid Topics v1.0.0
├── Fluid Topics v1.1.0
├── Fluid Topics v1.1.1
├── Fluid Topics v1.2.0
└── Fluid Topics v1.10.0

When applying the Relevance default sort, the document and its topics are ordered in the following way on the Search page:

Fluid Topics release notes
Fluid Topics v1.0.0
Fluid Topics v1.1.0
Fluid Topics v1.1.1
Fluid Topics v1.10.0
Fluid Topics v1.2.0

There is an issue with the search results: topic Fluid Topics v1.10.0 is ranked before topic Fluid Topics v1.2.0 because 1 is ranked before 2 in lexicographic order (the default sort order). To solve this issue, users should modify the Relevance default sort to use NATURAL sort for the ft:title metadata key.

For example:

afs:relevance,DESC; ft:isPublication,DESC; ft:isArticle,ASC; ft:title,ASC,NATURAL; ft:lastEdition,DESC

The document and its topics are now ordered as follows:

Fluid Topics release notes
Fluid Topics v1.0.0
Fluid Topics v1.1.0
Fluid Topics v1.1.1
Fluid Topics v1.10.0
Fluid Topics v1.2.0

Natural sort order is particularly well-suited for this use case as:

While standard alphabetical order compares strings character-by-character (where "10" sorts before "2" because "1" is less than "2"), natural sort order orders them by magnitude of the number, placing "2" before "10".

Natural sort order is designed to address the shortcoming of standard lexicographical order, which often produces counter-intuitive results for humans when dealing with numbered lists, filenames, or version numbers. -- Wikipedia