Koha-clms/Koha/SearchEngine
Fridolin Somers bc779c2c87 Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
44d6528b56/Koha/Authorities.pm (L80)

With Zebra searchengin it is correct.

But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
44d6528b56/Koha/SearchEngine/Elasticsearch/Search.pm (L346)

This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.

:(

I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.

Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
   without patch you get 100 results
   with patch you get no results
8) Perform a search 'an:222'
   without patch you get 102 results
   with patch you get 202 results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48d4b016ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eae8863fcb)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit e82827673a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2022-07-14 21:40:22 +02:00
..
Elasticsearch Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch 2022-07-14 21:40:22 +02:00
Zebra Bug 29418: Make clean_search_term escape double quotes 2022-07-14 21:40:22 +02:00
Elasticsearch.pm Bug 25030: Implement IncludeSeeFromInSearches with Elasticsearch 2021-10-22 11:25:40 -04:00
Indexer.pm Bug 25265: Prevent double reindex of the same item in batchmod 2020-09-28 10:10:08 +02:00
QueryBuilder.pm Bug 12478: allow more granular sorting configuration 2016-04-26 20:20:08 +00:00
Search.pm Bug 23763: Create a pagination_bar routine 2021-02-08 17:09:32 +01:00