[Bug 22801] New: Advance search yr uses copydate instead of date-of-publication
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Bug ID: 22801 Summary: Advance search yr uses copydate instead of date-of-publication Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com Target Milestone: --- In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22524 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Not sure if it helps, but for MARC21 the date range uses 008 and the publication year option int he pull down uses 260$c (maybe also 264$c, haven't checked). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- This is actually in etc/zebradb/ccl.properties : #Date 30 The point of time at which 005, 008/00-05, # a transaction or event 008/07-10, 260$c, # takes place. 008/11-14, 033,etc. # interpreting this as the copyright date in 260$c (MARC21) and 210$d (UNIMARC) copydate 1=30 r=r #Date-publication 31 The date (usually year) in 008/07-10, 260$c # which a document is published. 046, 533$d Date-of-publication 1=31 r=r yr Date-of-publication pubdate Date-of-publication -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, so copydate = 260$c 443 <!--record.abs line 121: melm 260$c copydate,copydate:s--> 444 <index_subfields tag="260" subfields="c"> 445 <target_index>copydate:w</target_index> 446 <target_index>copydate:s</target_index> 447 </index_subfields> And pubdate 008: 49 <index_control_field tag="008" offset="7" length="4"> 50 <target_index>pubdate:w</target_index> 51 </index_control_field> and pubdate = yr = Date-of-publication ... and we are missing proper indexing of 264 (see 15704) It seems I missed a change to advanced search, could have sworn we had publication year in the drop downs too. :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@collect | |o.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |22524 CC| |nick@bywatersolutions.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22524 [Bug 22524] Elasticsearch - Date range in advanced search -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 e.betemps <e.betemps@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |e.betemps@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|marjorie.barry-vila@collect | |o.ca | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@collect | |o.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #4 from Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> --- +1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick.robitaille@collecto | |.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #5 from Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> --- Hi, Does anyone work on this problem? If not, is there a way around the problem with configuring indexes? Regards, Marjorie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115666&action=edit Bug 22801: Advance search yr must use date-of-publication and not copydate In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', This patch uses %index_field_convert to perform 'yr' limit. Test plan: 1) Apply patch 2) Use Elasticsearch searchengine 3) Go to advanced search with 'More options' 4) Perform a search with a year limit (value or range) 5) Check results are correct -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115666|0 |1 is obsolete| | --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122064&action=edit Bug 22801: Advance search yr must use date-of-publication and not copydate In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', This patch uses %index_field_convert to perform 'yr' limit. Test plan: 1) Apply patch 2) Use Elasticsearch searchengine 3) Go to advanced search with 'More options' 4) Perform a search with a year limit (value or range) 5) Check results are correct Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122065 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122065&action=edit Bug 22801: (follow-up) Use date-of-publication directly Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Hi Frido, I added a followup to remove: my $yrfield = ( exists $index_field_convert{'yr'} ) ? $index_field_convert{'yr'} : 'yr'; The index_field_convert will always be built the same, so will always resolve to date-of-publication - so we don't need the condition, right? I also update tests to pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122064|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 122066 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122066&action=edit Bug 22801: Advance search yr must use date-of-publication and not copydate In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', This patch uses %index_field_convert to perform 'yr' limit. Test plan: 1) Apply patch 2) Use Elasticsearch searchengine 3) Go to advanced search with 'More options' 4) Perform a search with a year limit (value or range) 5) Check results are correct Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to David Nind from comment #10)
Signed-off-by: David Nind <david@davidnind.com>
Looks like we overlapped, can you test with second patch as well David? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #12 from David Nind <david@davidnind.com> ---
Looks like we overlapped, can you test with second patch as well David?
Will do! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122066|0 |1 is obsolete| | --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 122069 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122069&action=edit Bug 22801: Advance search yr must use date-of-publication and not copydate In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', This patch uses %index_field_convert to perform 'yr' limit. Test plan: 1) Apply patch 2) Use Elasticsearch searchengine 3) Go to advanced search with 'More options' 4) Perform a search with a year limit (value or range) 5) Check results are correct Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122065|0 |1 is obsolete| | --- Comment #14 from David Nind <david@davidnind.com> --- Created attachment 122070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122070&action=edit Bug 22801: (follow-up) Use date-of-publication directly Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #15 from David Nind <david@davidnind.com> --- Testing notes (koha-testing-docker): - tested first using Zebra: works as expected - changed search engine to Elastic and reindexed - change a record so that 008 and 260$c have different values (such as 2009 and 2011) - use the advanced search form > more options > limits > year to search on the 008 value (such as 2009) => record will NOT appear in the search results - search using the 260$c value (such as 2011) => record WILL appear in the search results - apply the patch (and reindex - not sure whether this is necessary, but did anyway) - correct behavour should now occur: . results for limit search should show matching record with 008 value, not 260$c value -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the advanced release notes| |search form in the OPAC and | |staff interface so that the | |publication date (and | |range) uses the value(s) in | |008 instead of 260$c when | |using Elasticsearch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |kyle@bywatersolutions.com CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122069|0 |1 is obsolete| | Attachment #122070|0 |1 is obsolete| | --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 123138 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123138&action=edit Bug 22801: Advance search yr must use date-of-publication and not copydate In advanced search with Elasticsearch the limit on years range is actually using copydate : Koha/SearchEngine/Elasticsearch/QueryBuilder.pm in _fix_limit_special_cases() : if ( $l =~ /^yr,st-numeric,ge=/ ) { my ( $start, $end ) = ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); next unless defined($start) && defined($end); push @new_lim, "copydate:[$start TO $end]"; } With Zebra it uses date-of-publication and also in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm : our %index_field_convert = ( (...) 'yr' => 'date-of-publication', This patch uses %index_field_convert to perform 'yr' limit. Test plan: 1) Apply patch 2) Use Elasticsearch searchengine 3) Go to advanced search with 'More options' 4) Perform a search with a year limit (value or range) 5) Check results are correct Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 123139 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123139&action=edit Bug 22801: (follow-up) Use date-of-publication directly Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|21.11.00 |21.11.00,21.05.03 released in| | --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x fro 21.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|21.11.00,21.05.03 |21.11.00,21.05.03,20.11.09 released in| | --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.09 Viva Elasticsearch ^^ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 20.05.x, it shouldn't be affected, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22801 --- Comment #22 from Victor Grousset/tuxayo <victor@tuxayo.net> --- errata: no issue related to dependencies, anyway: Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org