Bugzilla – Attachment 69076 Details for
Bug 19559
Elasticsearch QueryAutoTruncate truncate field names with hyphens if data is quoted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19559 - Add '-' to list of characters we don't split search terms on
Bug-19559---Add---to-list-of-characters-we-dont-sp.patch (text/plain), 1.51 KB, created by
Julian Maurice
on 2017-11-10 09:42:54 UTC
(
hide
)
Description:
Bug 19559 - Add '-' to list of characters we don't split search terms on
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-11-10 09:42:54 UTC
Size:
1.51 KB
patch
obsolete
>From 7adf55f03e114896e860d5974baaec5dc232363c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 1 Nov 2017 15:47:39 +0000 >Subject: [PATCH] Bug 19559 - Add '-' to list of characters we don't split > search terms on > >Test plan assumes >QueryAutoTruncate = automatically >SearchEngine = Elasticsearch > >To test: >0 - Apply Unit test patch only >1 - prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >2 - Should fail >3 - Apply this patch >4 - prove t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >5 - should pass >6 - search for 'Local-number:"4"' (or a vlid biblionumber) >7 - should get expected result > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index cdd0fc6bd1..a021a0cb52 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -798,7 +798,7 @@ sub _truncate_terms { > > # '"donald duck" title:"the mouse" and peter" get split into > # ['', '"donald duck"', '', ' ', '', 'title:"the mouse"', '', ' ', 'and', ' ', 'pete'] >- my @tokens = split /((?:\w+:)?"[^"]+"|\s+)/, $query; >+ my @tokens = split /((?:[\w-]+:)?"[^"]+"|\s+)/, $query; > > # Filter out empty tokens > my @words = grep { $_ !~ /^\s*$/ } @tokens; >-- >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 19559
:
68881
|
68882
|
68924
|
68925
|
69075
| 69076