Summary: | SearchEngine::simple_search_compat should not limit to 100 records for ElasticSearch (causing incomplete authority merges) | ||
---|---|---|---|
Product: | Koha | Reporter: | Bernard <bernard.scaife> |
Component: | Searching - Elasticsearch | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | major | ||
Priority: | P5 - low | CC: | fridolin.somers, m.de.rooy, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
Bernard
2022-04-13 11:30:24 UTC
Interesting. Could provide details about the version you experience this? I tested this: use Modern::Perl; use Data::Dumper qw/Dumper/; use Koha::Authorities; my @biblionumbers = Koha::Authorities->linked_biblionumbers({ authid => 1 }); print Dumper( scalar @biblionumbers ); I have 149 biblionumbers attached to authid 1. And got this result: $VAR1 = 149; So that should be fine (as a first check). But I am seeing something funny. From my 149 records, 148 records have been updated when I made a change in the authority. But one record (somewhere in the middle) has not been updated! Note that 148 > 100 records and this tells me that your problem does not occur in current master. And I do think that 21.11 and master are not different as to merging authorities. Could you clarify/show more details about your conclusion that only 100 records were updated in your catalog? How do you reach that conclusion? (In reply to Marcel de Rooy from comment #2) > From my 149 records, 148 records have been updated when I made a change in > the authority. But one record (somewhere in the middle) has not been updated! This must have been something else. From a previous test. Created with build_sample_biblio. I removed all those records. Created 200 records. Linked to authid 1. Changed authid 1. All 200 records are merged by the cron script. All working fine. It's version 21.11.01.000
I've just run your little script:
use Modern::Perl;
use Data::Dumper qw/Dumper/;
use Koha::Authorities;
my @biblionumbers = Koha::Authorities->linked_biblionumbers({ authid => 7307 });
print Dumper( scalar @biblionumbers );
>>>
$ perl /home2/kfc/kohaclone/Koha/bertest.pl
$VAR1 = 100;
There are 104 bib records linked to this authority
(In reply to Bernard from comment #4) > It's version 21.11.01.000 > > I've just run your little script: > > use Modern::Perl; > use Data::Dumper qw/Dumper/; > use Koha::Authorities; > my @biblionumbers = Koha::Authorities->linked_biblionumbers({ authid => 7307 > }); > print Dumper( scalar @biblionumbers ); > > >>> > > $ perl /home2/kfc/kohaclone/Koha/bertest.pl > $VAR1 = 100; > > There are 104 bib records linked to this authority Found it! You are using ElasticSearch, I used Zebra. The cause is in the Koha/SearchEngine/ElasticSearch/Search.pm module: sub simple_search_compat { my ($self, $query, $offset, $max_results) = @_; return ('No query entered', undef, undef) unless $query; my %options; $offset = 0 if not defined $offset or $offset < 0; $options{offset} = $offset; $max_results //= 100; => This sub expects a max_results parameter for Elastic while the Zebra one does not require it. No max_results means there all results. So we need to adjust that one somehow. CCing Nick and Tomas. Good catch ! |