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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 10 Sep 2019 08:39:43 +0000 (09:39 +0100)
commit949e36c7b8a11cd185025a4c9e102f0e26205009
tree880e321c1336ca1f0b111cd01580b78cfee229aa
parenta7d5a4cc82ad7a1402eb0d11fd6d9613cadfa13a
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>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm