Bug 19604: Elasticsearch Fixes for build_authorities_query for auth searching
authorNick Clemens <nick@bywatersolutions.com>
Thu, 9 Nov 2017 16:23:57 +0000 (16:23 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Aug 2018 12:59:34 +0000 (13:59 +0100)
commit7b8ea20bce5e1e2329536677dba049a768f19a83
tree054fdab0251de6eb65530015c1106329eb8414cd
parent9529ddd29baa9946d577ba1b9cb4d02a08450c0f
Bug 19604: Elasticsearch Fixes for build_authorities_query for auth searching

To test:
1 - Do some authority searches in Zebra
2 - Switch to ES and repeat, results will vary and some may fail
3 - Apply patch and dependencies
4 - Reindex ES
5 - Repeat searches, they should suceed and results should be similar to
Zebra
6 - Slight differences are okay, but results should (mostly) meet
expectations

A few notes:
We add a 'normalizer' to ensure we get a single token from the heading
indexes, this makes 'starts with' work as expcted
We switch to 'AND' for fields searched from cataloging editor - this
matches Zebra results
We force the '__sort' fields for sorting - if sorting looks wrong try
reducing the heading field to a single subfield - this will need to be
addressed on a future bug (multiple subfields create an array, ES sorts
        those randomly)

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f983c1e3f7404c60143d595ba5824f5324829723)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/SearchEngine/Elasticsearch.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm