Bugzilla – Attachment 135997 Details for
Bug 30883
Authorities merge is limited to 100 biblio with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
Bug-30883-Authorities-merge-is-limited-to-100-bibl.patch (text/plain), 2.82 KB, created by
Martin Renvoize
on 2022-06-13 08:32:31 UTC
(
hide
)
Description:
Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-06-13 08:32:31 UTC
Size:
2.82 KB
patch
obsolete
>From 2636ddc4cc09ee812b7b34362368c98ee511203a Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 1 Jun 2022 21:23:23 -1000 >Subject: [PATCH] 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 : >https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/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 : >https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/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> >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index fc7eda5816..0a1bc7ccc9 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -304,8 +304,8 @@ How many results to skip from the start of the results. > > =item C<$max_results> > >-The max number of results to return. The default is 100 (because unlimited >-is a pretty terrible thing to do.) >+The max number of results to return. >+The default is the result of method max_result_window(). > > =item C<%options> > >@@ -343,7 +343,7 @@ sub simple_search_compat { > my %options; > $offset = 0 if not defined $offset or $offset < 0; > $options{offset} = $offset; >- $max_results //= 100; >+ $max_results //= $self->max_result_window; > > unless (ref $query) { > # We'll push it through the query builder to sanitise everything. >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30883
:
135573
|
135699
| 135997