Bugzilla – Attachment 94800 Details for
Bug 23521
ES 6 - limit terms with many words can make the search inaccurate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23521: (follow-up) Add quotes
Bug-23521-follow-up-Add-quotes.patch (text/plain), 3.07 KB, created by
Ere Maijala
on 2019-10-25 19:36:53 UTC
(
hide
)
Description:
Bug 23521: (follow-up) Add quotes
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2019-10-25 19:36:53 UTC
Size:
3.07 KB
patch
obsolete
>From 2852642268dd26026b8e387841be8d645f7e8b16 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 25 Oct 2019 13:49:05 +0000 >Subject: [PATCH] Bug 23521: (follow-up) Add quotes > >Not only should terms from facets/limits be grouped, but order should probably matter >We build a different facet for "Dillinger Girl" or "Girl Dillinger" > >The parens are possibly overkill now, but I think it makes it very clear and does not hurt > >To test: >1 - Follow original plan >2 - Create a new record with 'Girl Dillinger' as author >3 - Search for 'Dill*' >4 - You get all three records (and maybe others that match) >5 - Limit by 'Girl Dillinger' - you get two records >6 - Same for 'Dillinger Girl' >7 - Apply patch >8 - Limits/facets for 'Dillinger Girl' and 'Girl Dillinger' now match a isngle record > >Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > .../Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 8 ++++---- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 2ce8328562..102de1bf04 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -970,7 +970,7 @@ sub _fix_limit_special_cases { > else { > my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/; > if ( defined($field) && defined($term) ) { >- push @new_lim, "$field:($term)"; >+ push @new_lim, "$field:(\"$term\")"; > } > else { > push @new_lim, $l; >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index 1afa8d8c29..9d0dfa303f 100644 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -441,15 +441,15 @@ subtest 'build_query tests' => sub { > ( undef, $query ) = $qb->build_query_compat( ['AND'], ['title:"donald duck"'], undef, ['author:Dillinger Escaplan'] ); > is( > $query->{query}{query_string}{query}, >- '(title:"donald duck") AND author:(Dillinger Escaplan)', >- "Simplle query with limit's term in parentheses" >+ '(title:"donald duck") AND author:("Dillinger Escaplan")', >+ "Simple query with limit term quoted in parentheses" > ); > > ( undef, $query ) = $qb->build_query_compat( ['AND'], ['title:"donald duck"'], undef, ['author:Dillinger Escaplan', 'itype:BOOK'] ); > is( > $query->{query}{query_string}{query}, >- '(title:"donald duck") AND (author:(Dillinger Escaplan)) AND (itype:(BOOK))', >- "Simplle query with each limit's term in parentheses" >+ '(title:"donald duck") AND (author:("Dillinger Escaplan")) AND (itype:("BOOK"))', >+ "Simple query with each limit's term quoted in parentheses" > ); > is($query_cgi, 'idx=&q=title%3A%22donald%20duck%22', 'query cgi'); > is($query_desc, 'title:"donald duck"', 'query desc ok'); >-- >2.17.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 23521
:
92498
|
93741
|
94771
|
94772
|
94799
| 94800