Bugzilla – Attachment 73412 Details for
Bug 20492
Add missing case for advanced search year limit in _fix_limit_special_cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20492: Add missing case for advanced search year limit
Bug-20492-Add-missing-case-for-advanced-search-yea.patch (text/plain), 1.61 KB, created by
David Gustafsson
on 2018-03-29 10:15:42 UTC
(
hide
)
Description:
Bug 20492: Add missing case for advanced search year limit
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2018-03-29 10:15:42 UTC
Size:
1.61 KB
patch
obsolete
>From 47069f3c70d0875b7be3efbca40dbaf64aa00ec4 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Thu, 29 Mar 2018 12:00:14 +0200 >Subject: [PATCH] Bug 20492: Add missing case for advanced search year limit > >Add missing case for when using "year" limit in advanced search, >which results the zebra limit "yr,st-numeric=YYYY-YYYY". >This will now be convered to an ElasticSearch range. > >How to test: >1) Perform a year limit search by choosing "More options" in > advanced search page and enter a year range that should > produce results. >2) This should not produce the expected results. >3) Apply patch >4) Perform the same search again, it should now produce the > expected results. > >Sponsored-by: Gothenburg University Library >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 95cc86ab78..a1bf519e54 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -751,6 +751,11 @@ sub _fix_limit_special_cases { > next unless defined($start) && defined($end); > push @new_lim, "copydate:[$start TO $end]"; > } >+ elsif ( $l =~ /^yr,st-numeric=(\d*|[*])-(\d*|[*])$/ ) { >+ my $start = $1 || '*'; >+ my $end = $2 || '*'; >+ push @new_lim, "copydate:[$start TO $end]"; >+ } > elsif ( $l =~ /^yr,st-numeric=/ ) { > my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ ); > next unless defined($date); >-- >2.11.0
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 20492
: 73412