Bugzilla – Attachment 169308 Details for
Bug 37333
Search filters using OR are not correctly grouped
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37333: (follow-up) Update existing tests
Bug-37333-follow-up-Update-existing-tests.patch (text/plain), 4.85 KB, created by
Martin Renvoize (ashimema)
on 2024-07-22 14:55:29 UTC
(
hide
)
Description:
Bug 37333: (follow-up) Update existing tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-22 14:55:29 UTC
Size:
4.85 KB
patch
obsolete
>From 21dc76f35b54adac2fed03d0919ba08fdeec948a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 22 Jul 2024 15:53:48 +0100 >Subject: [PATCH] Bug 37333: (follow-up) Update existing tests > >We add a level of bracket nesting. I checked with Nick that this >shouldn't cause any issues in the queries and we agreed it made sense so >I've gone ahead and updated the tests to reflect the change. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 8 ++++---- > t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t | 8 ++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index 237e387cfbc..cf36311dfea 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -819,9 +819,9 @@ subtest "Handle search filters" => sub { > > my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); > >- is( $limit,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit correctly formed"); >+ is( $limit,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit correctly formed"); > is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); >- is( $limit_desc,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded"); >+ is( $limit_desc,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded"); > > $filter = Koha::SearchFilter->new({ > name => "test", >@@ -832,9 +832,9 @@ subtest "Handle search filters" => sub { > > ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); > >- is( $limit,q{(subject:biography)},"Limit correctly formed for ccl type query"); >+ is( $limit,q{((subject:biography))},"Limit correctly formed for ccl type query"); > is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); >- is( $limit_desc,q{(subject:biography)},"Limit description is correctly handled for ccl type query"); >+ is( $limit_desc,q{((subject:biography))},"Limit description is correctly handled for ccl type query"); > > }; > >diff --git a/t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t >index 5a8fdb8f50a..df8cfce77f1 100755 >--- a/t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t >@@ -116,9 +116,9 @@ subtest "Handle search filters" => sub { > > my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); > >- is( $limit,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed"); >+ is( $limit,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit correctly formed"); > is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); >- is( $limit_desc,q{kw=(cat) AND ti=(bat) OR au=(rat) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded"); >+ is( $limit_desc,q{(kw=(cat) AND ti=(bat) OR au=(rat)) and (mc-itype,phr=BK or mc-itype,phr=MU) and (( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) ))},"Limit description is correctly expanded"); > > $filter = Koha::SearchFilter->new({ > name => "test", >@@ -129,8 +129,8 @@ subtest "Handle search filters" => sub { > > ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] ); > >- is( $limit,q{(su=biography)},"Limit correctly formed for ccl type query"); >+ is( $limit,q{((su=biography))},"Limit correctly formed for ccl type query"); > is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded"); >- is( $limit_desc,q{(su=biography)},"Limit description is correctly handled for ccl type query"); >+ is( $limit_desc,q{((su=biography))},"Limit description is correctly handled for ccl type query"); > > }; >-- >2.45.2
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 37333
:
168864
|
168894
|
169099
| 169308