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
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
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>
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>
Works well, nice improvement. Passing QA
Isn't something ES can do internally? Did you investigate it?
(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
Pushed to master for 21.11, thanks to everybody involved!
*** Bug 25838 has been marked as a duplicate of this bug. ***
*** Bug 23036 has been marked as a duplicate of this bug. ***
Pushed to 21.05.x for 21.05.05
Pushed to 20.11.x for 20.11.11
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.