projectEndings / staticSearch

A codebase to support a pure JSON search engine requiring no backend for any XHTML5 document collection
https://endings.uvic.ca/staticSearch/docs/index.html
Mozilla Public License 2.0
50 stars 22 forks source link

Feature filter values should sort alphabetically #227

Closed martindholmes closed 2 years ago

martindholmes commented 2 years ago

I have one very large (13,000+) feature filter for poem titles in DVPP, and I'm noticing that one of the most valuable things you can do with it is to type (e.g.) "Sonnet" and see all the titles that contain the word "Sonnet". However, if you want to find the exact title "Sonnet", you have to scroll through a lot of unsorted options. So I think feature filters should be sorted alphabetically by default in the JSON, which I think would carry through into the drop-down menu in the filter control.

martindholmes commented 2 years ago

Commit #5e162d5 does this in a simple manner that works pretty well. I'll do a pull request.

martindholmes commented 2 years ago

I wonder if I should have lower-cased the grouping key first... I can't think of a reason not to do that, can you @joeytakeda?

martindholmes commented 2 years ago

In other words, <xsl:sort select="lower-case(current-grouping-key())"/>.

joeytakeda commented 2 years ago

I can’t see any reason not to—seems like the right thing to do to me

martindholmes commented 2 years ago

Done in dev. I'll close the ticket and delete the branch.