Bug 23004: Missing authtype filter in auth_finder.pl
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 29 May 2019 06:15:08 +0000 (08:15 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 13 Sep 2019 12:50:16 +0000 (14:50 +0200)
commit1d8b1fafc4dbdc54108dbe2ff949d612cde6b99e
tree0ea588b07c501083ccbd14f07a895853339e113f
parent92b966a87a74d58e5fdf5a252365175cc2397e9f
Bug 23004: Missing authtype filter in auth_finder.pl

In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type.
This limit is missing with Elasticsearch.

This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part.

Test plan :
1) Use Elasticsearch
2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien"
3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien"
4) Create a biblio record
5) Use tag editor on a author field (700 in UNIMARC)
6) Seach for "Tolkien" in $a
without patch : you see the 2 authorities in results
with patch : you see only the correct authority in results (NP in UNIMARC)
7) Check search in authorities-home.pl is still OK

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 949e36c7b8a11cd185025a4c9e102f0e26205009)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm