1.17.1 Sorting
The sorting of the search hit list can be configured as follows:
config_viewer.xml
1
<search>
2
<sorting enabled="true">
3
<field>RANDOM</field>
4
<field default="true">RELEVANCE</field>
5
<field>SORT_CREATOR</field>
6
<field dropDownAscMessageKey="searchSortingDropdown_az" dropDownDescMessageKey="searchSortingDropdown_za">SORT_TITLE</field>
7
<field>SORT_YEARPUBLISH\;SORT_TITLE</field>
8
<static>
9
<field>BOOL_PRIORITIZE</field>
10
</static>
11
</sorting>
12
</search>
Copied!
With the Attribute enabled the sorting can be switched off completely (default value is true). The elements <field> define the Solr fields, according to which the sorting can be done. The order of the listing corresponds to the displayed order. For each configured field, an ascending and descending option is automatically displayed.
If a sort field is to be used immediately on the first search, before the user has selected an explicit sort, this can be displayed with the default="true" attribute.
The terms RELEVANCE and RANDOM are static terms for which no ascending and descending option is provided.
For the ascending and descending options, the words ascending and descending are used by default. However, the attributes dropDownAscMessageKey and dropDownDescMessageKey can be used to define a custom value. In the example above, this has been done for the title, where alternatively "A-Z" and "Z-A" are displayed.
Several sort fields can be specified one after the other, separated by semicolons. An example is shown in the above code block with SORT_YEARPULISH;SORT_TITLE. This means that the hits are first sorted by SORT_YEARPUBLISH. The records that do not contain the metadata are listed below according to SORT_TITLE.
An additional static list of sort fields <static> can be used to always place certain works on top based on the presence of a certain index field. The fields configured here are applied in the sort order before the normal sort fields and are not visible to the user.
The fields used for sorting must not be fields with multiple values (that is, in their declaration in /opt/digiverso/solr/solr/server/solr/configsets/goobiviewer/conf/schema.xml, the multiValued attribute must not have the value true).
Last modified 4d ago
Copy link