Bugzilla – Attachment 106339 Details for
Bug 25882
Elasticsearch - Advanced search itemtype limits are being double quoted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25882: Remove phr indicator from limits when processing
Bug-25882-Remove-phr-indicator-from-limits-when-pr.patch (text/plain), 1.67 KB, created by
Nick Clemens (kidclamp)
on 2020-06-26 13:22:45 UTC
(
hide
)
Description:
Bug 25882: Remove phr indicator from limits when processing
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-06-26 13:22:45 UTC
Size:
1.67 KB
patch
obsolete
>From 78c5af6969693608cdc785621977dd52d66c89bc Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 26 Jun 2020 13:19:47 +0000 >Subject: [PATCH] Bug 25882: Remove phr indicator from limits when processing > >We assume all limits from advanced search to be a phrase and quote them >when doing this we should remove the phrase marker to avoid doulbe quoting > >To test: > 1 - Have koha using ES > 2 - Go to advanced search > 3 - Limit by a single itemtype that exists > 4 - Get some results > 5 - Limit by a different itemtype that exists > 6 - Get some results > 7 - Limit by both itemtypes > 8 - Get only the results for the second itemtype > 9 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate >10 - Repeat search >11 - View page source and find 'search_query' >12 - See limit looks like itype:("("BK")" OR "("CR")") >13 - Apply patches >14 - Restart all the things >15 - Repeat search for both itemtypes >16 - Note results now include both types >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 3c6aaa42b1..8ced1dcbfa 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -1014,6 +1014,7 @@ sub _fix_limit_special_cases { > } > else { > my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/; >+ $field =~ s/,phr$//; #We are quoting all the limits as phrase, this prevents from quoting again later > if ( defined($field) && defined($term) ) { > push @new_lim, "$field:(\"$term\")"; > } >-- >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 25882
:
106338
|
106339
|
106342
|
106343
|
106344
|
108067
|
108068