Koha-clms/Koha/SearchEngine
Nick Clemens 1f9a4e190a
Bug 40658: Use local-number__sort and not local-number directly
This patch makes sure we inject the __sort form of local-number, rather
than the field directly - this ensurs searching works even if mappings mayu
be different and local-number itself is not numeric

To test:
1 - Edit mappings.yaml and set local-number from 'number' to 'string'
    NOTE: There are two copies of local-number - one in auth and one in biblio - the latter is the important one here
2 - perl misc/search_tools/rebuild_elasticsearch.pl -r -v
3 - Confirm in staff interface Admin -> Search Engine Configuration that local-number is now a string
4 - Search and get an error
    Error: Unable to perform your search. Please try again.
    In the logs:
[illegal_argument_exception] Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [local-number] in order to load field data by uninverting the inverted index. Note that this can use significant memory.
5 - Apply patch, restart all
6 - Search again
7 - Success!

Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 649fbbf452)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-05-24 13:42:25 +01:00
..
Elasticsearch Bug 40658: Use local-number__sort and not local-number directly 2026-05-24 13:42:25 +01:00
Zebra Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Elasticsearch.pm Bug 39580: Make Elasticsearch process_error error string translatable 2026-04-13 09:35:09 +01:00
Indexer.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
QueryBuilder.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Search.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00