Bugzilla – Attachment 122065 Details for
Bug 22801
Advance search yr uses copydate instead of date-of-publication
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22801: (follow-up) Use date-of-publication directly
Bug-22801-follow-up-Use-date-of-publication-direct.patch (text/plain), 2.61 KB, created by
Nick Clemens (kidclamp)
on 2021-06-17 12:37:47 UTC
(
hide
)
Description:
Bug 22801: (follow-up) Use date-of-publication directly
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-06-17 12:37:47 UTC
Size:
2.61 KB
patch
obsolete
>From daee9605e66a1efac4f6b730bed3db4818d38a32 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 17 Jun 2021 12:36:01 +0000 >Subject: [PATCH] Bug 22801: (follow-up) Use date-of-publication directly > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 7 ++----- > .../Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 2 +- > 2 files changed, 3 insertions(+), 6 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 2294f82142..a894782c18 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -995,9 +995,6 @@ The argument should be an arrayref, and it'll return an arrayref. > sub _fix_limit_special_cases { > my ( $self, $limits ) = @_; > >- # yr is usually an alias of a search field >- my $yrfield = ( exists $index_field_convert{'yr'} ) ? $index_field_convert{'yr'} : 'yr'; >- > my @new_lim; > foreach my $l (@$limits) { > >@@ -1006,13 +1003,13 @@ sub _fix_limit_special_cases { > my ( $start, $end ) = > ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ ); > next unless defined($start) && defined($end); >- push @new_lim, "$yrfield:[$start TO $end]"; >+ push @new_lim, "date-of-publication:[$start TO $end]"; > } > elsif ( $l =~ /^yr,st-numeric=/ ) { > my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ ); > next unless defined($date); > $date = $self->_modify_string_by_type(type => 'st-year', operand => $date); >- push @new_lim, "$yrfield:$date"; >+ push @new_lim, "date-of-publication:$date"; > } > elsif ( $l =~ /^available$/ ) { > push @new_lim, 'onloan:false'; >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index d8922c3eee..8de1607f40 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -337,7 +337,7 @@ subtest 'build_query tests' => sub { > ( undef, $query ) = $qb->build_query_compat( undef, ['2019-'], ['yr,st-year'], ['yr,st-numeric=-2019'] ); > is( > $query->{query}{query_string}{query}, >- '(date-of-publication:[2019 TO *]) AND copydate:[* TO 2019]', >+ '(date-of-publication:[2019 TO *]) AND date-of-publication:[* TO 2019]', > 'Open end year in year range of an st-year search is handled properly' > ); > >-- >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 22801
:
115666
|
122064
|
122065
|
122066
|
122069
|
122070
|
123138
|
123139