Bug 28826 - Facet sort order differs between search engines
Summary: Facet sort order differs between search engines
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
: 23036 25838 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-08-06 18:39 UTC by Nick Clemens
Modified: 2022-06-06 20:25 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 28826: Add FacetOrder system preference (5.09 KB, patch)
2021-08-06 18:56 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28826: Add FacetOrder system preference (5.14 KB, patch)
2021-08-08 17:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 28826: Add FacetOrder system preference (5.21 KB, patch)
2021-09-24 16:03 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-08-06 18:39:18 UTC
In Zebra we sort the facets alphabetically by default - they are built in count order

In Elasticsearch we display them as built, in count order

There should be a configuration and we should sort them according to that
Comment 1 Nick Clemens 2021-08-06 18:56:02 UTC
Created attachment 123586 [details] [review]
Bug 28826: Add FacetOrder system preference

This bug adds a system preference to control ordering of facets and
adds the control to both Zebra and Elasticsearch

To test:
1 - Have a koha that can use both Zebra and ES
2 - Set 'displayFacetCount' to true
3 - Search in ES and Zebra
4 - Note facets in Zebra sorted alphabetically, ES by usage
5 - Apply patch, updatedatabase
6 - Search in ES and Zebra, facets are alphabetically sorted in both
7 - Find new syspref FacetOrder and set to 'by usage'
8 - Search in both engines, facets sorted by usage
Comment 2 David Nind 2021-08-08 17:46:51 UTC
Created attachment 123599 [details] [review]
Bug 28826: Add FacetOrder system preference

This bug adds a system preference to control ordering of facets and
adds the control to both Zebra and Elasticsearch

To test:
1 - Have a koha that can use both Zebra and ES
2 - Set 'displayFacetCount' to true
3 - Search in ES and Zebra
4 - Note facets in Zebra sorted alphabetically, ES by usage
5 - Apply patch, updatedatabase
6 - Search in ES and Zebra, facets are alphabetically sorted in both
7 - Find new syspref FacetOrder and set to 'by usage'
8 - Search in both engines, facets sorted by usage

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize 2021-09-24 16:03:58 UTC
Created attachment 125286 [details] [review]
Bug 28826: Add FacetOrder system preference

This bug adds a system preference to control ordering of facets and
adds the control to both Zebra and Elasticsearch

To test:
1 - Have a koha that can use both Zebra and ES
2 - Set 'displayFacetCount' to true
3 - Search in ES and Zebra
4 - Note facets in Zebra sorted alphabetically, ES by usage
5 - Apply patch, updatedatabase
6 - Search in ES and Zebra, facets are alphabetically sorted in both
7 - Find new syspref FacetOrder and set to 'by usage'
8 - Search in both engines, facets sorted by usage

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-09-24 16:04:43 UTC
Works well, nice improvement.

Passing QA
Comment 5 Jonathan Druart 2021-09-28 11:35:33 UTC
Isn't something ES can do internally? Did you investigate it?
Comment 6 Nick Clemens 2021-09-28 13:45:58 UTC
(In reply to Jonathan Druart from comment #5)
> Isn't something ES can do internally? Did you investigate it?

There is a facet order option, however, many of our facets are authorised values that we convert to display names, i.e. branchcodes into branchnames

Sorting in ES would be based on the codes and not the display values
Comment 7 Jonathan Druart 2021-09-29 10:44:23 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-10-05 10:12:39 UTC
*** Bug 25838 has been marked as a duplicate of this bug. ***
Comment 9 Fridolin Somers 2021-10-05 10:12:59 UTC
*** Bug 23036 has been marked as a duplicate of this bug. ***
Comment 10 Kyle M Hall 2021-10-08 13:32:41 UTC
Pushed to 21.05.x for 21.05.05
Comment 11 Fridolin Somers 2021-10-21 03:58:04 UTC
Pushed to 20.11.x for 20.11.11
Comment 12 Victor Grousset/tuxayo 2021-10-26 00:39:19 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.