1.18.3 Sorting of collections

By default, your collections are sorted alphabetically by their names in the collection overview (that is, not by the names in messages_*.properties). However, it is possible to define your own sequence.

The following configuration determines how the collections are sorted:

<collections>
    <collection field="DC">
        <sorting>
            <collection>collection2</collection>
            <collection>collection1</collection>
        </sorting>
    </collection>
</collections>

Collections (raw names) that are listed here are listed first and in the specified order. All other collections are listed behind it in the standard sort (see above).

It is possible to sort certain parts of the collections. For this you can group the <collection> tags in a <sortingList>:

<collections>
    <collection field="DC">
        <sorting>
            <collection>collection2</collection>
            <collection>collection1</collection>
            <sortingList sortAfter="collection2">
                <collection>collection3</collection>
                <collection>collection4</collection>
            </sortingList>
        </sorting>
    </collection>
</collections>

The attribute sortAfter specifies the name of the collection behind which the collections listed in the sortingList are to be sorted.

If the collection specified in sortAfter has subcollections, but the first collection listed in the sortingList is on the same or a higher hierarchy level as the sortAfter collection, the collections of the sortingList are also sorted after all subcollections of the sortAfter collection.

If collections listed in <collections> have subcollections that are not contained in the sort list, they are sorted alphabetically within the listed collection.

It is also possible to specify the sorting for collections and/or sub-collections:

<collections>
    <collection field="DC">
        <sorting>
            <sortOrder collections="colregex.*">alphabetical_raw_desc</sortOrder>
            <sortOrder collections="newspaper.foo.*">alphanumerical_asc</sortOrder>
        </sorting>
    </collection>
</collections>

The <sortOrder /> element is repeatable. A regular expression to which the sorting is to be applied must be defined in the collections attribute. The following sorting schemes are available for sorting. All schemes can have the suffix _asc or_desc. _desc reverses the order, while _asc is identical to the scheme without the suffix.

  • numerical - Numerical sorting according to numerical values. If the collection names are not numbers, they are simply sorted alphabetically

  • alphabetical - Alphabetical sorting according to the translated collection names. If there are no translations for the collection names, this is identical to alphabetical_raw

  • alphabetical_raw - Alphabetical sorting according to the collection name as it appears in Solr

  • alphanumerical - Alphanumerical sorting, which always sorts alphabetically, but numbers contained in the name are sorted numerically. Sorts like alphabetical according to the translated collection names

Last updated

Was this helpful?