Alphabetical order for grc and la in facets

10 views
Skip to first unread message

Martina Filosa

unread,
Mar 21, 2023, 10:44:24 AM3/21/23
to efes-...@googlegroups.com
Dear all,

I just noticed that the items in the facets, when in grc or la, are not in the right order (see screenshot):

image.png

I understand that I have to tweak results-to-html in ROOT/stylesheet/solr probably with the same snippet of code we used for the alphabetical order of the indices in indices.xsl

<xsl:apply-templates select="doc"><xsl:sort select="translate(normalize-unicode(lower-case(.),'NFD'), '&#x0300;&#x0301;&#x0308;&#x0303;&#x0304;&#x0313;&#x0314;&#x0345;&#x0342;' ,'')"/></xsl:apply-templates>

But I still didn't menage to figure out how...

Any ideas?

Thanks in advance,

m. 

--

Martina Filosa, M.A.

Wissenschaftliche Mitarbeiterin

ANR/DFG DigiByzSeal - VolkswagenStiftung DiBS

Universität zu Köln
Institut für Altertumskunde
Abteilung Byzantinistik und Neugriechische Philologie
Albertus-Magnus-Platz
D-50923 Köln



Jamie Norrish

unread,
Mar 21, 2023, 6:04:44 PM3/21/23
to efes-...@googlegroups.com
On Tue, 2023-03-21 at 15:43 +0100, Martina Filosa wrote:

> I understand that I have to tweak results-to-html in
> ROOT/stylesheet/solr probably with the same snippet of code we used
> for the alphabetical order of the indices in indices.xsl

You want to add xsl:sort to the xsl:apply-templates call for unselected
facets in results-to-html.xsl on line 72. This is within the template
matching on lst[@name='facet_fields']/lst in the mode search-results.

You might, as an experiment, add a lang attribute to the xsl:sort
without doing the translation, just to see whether that helps. It's not
a generic solution: even if there is a pre-defined collation for grc,
there is no language information for the facet, nor any guarantee that
the facet values are in the same language. Of course, if you know that
all the values in a given facet are in the same language, you can
specify the language on a facet-by-facet basis, which might work well
enough.


As a second experiment, if you're willing to upgrade the version of
Saxon you are using[1], you might specify a collation attribute to the
xsl:sort without doing the translation, with an appropriate collation
URI. URIs you might try (one at a time) are:

* http://www.w3.org/2013/collation/UCA?strength=primary
*
http://www.w3.org/2013/collation/UCA?strength=primary&amp;normalization=yes

This may not work at all, but if one of the URIs produces the effect
desired, it is probably a better approach than using the translate
hack.


If you don't get one of the experimental solutions working, just use
the same xsl:sort as is used in the indices.


[1] Download the JAR files from
https://github.com/Saxonica/Saxon-HE/raw/main/12/Java/SaxonHE12-1J.zip
and place them all (including those in the lib directory of the ZIP
file) into webapps/ROOT/WEB-INF/lib and remove the previous saxon JAR
files. Restart EFES.


Jamie
Reply all
Reply to author
Forward
0 new messages