View | Details | Raw Unified | Return to bug 37333
Collapse All | Expand All

(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t (-4 / +4 lines)
Lines 819-827 subtest "Handle search filters" => sub { Link Here
819
819
820
    my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
820
    my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
821
821
822
    is( $limit,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit correctly formed");
822
    is( $limit,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit correctly formed");
823
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
823
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
824
    is( $limit_desc,q{(available:true) AND ((cat) AND title:(bat) OR author:(rat)) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded");
824
    is( $limit_desc,q{(available:true) AND (((cat) AND title:(bat) OR author:(rat))) AND itype:(("BK") OR ("MU"))},"Limit description is correctly expanded");
825
825
826
    $filter = Koha::SearchFilter->new({
826
    $filter = Koha::SearchFilter->new({
827
        name => "test",
827
        name => "test",
Lines 832-840 subtest "Handle search filters" => sub { Link Here
832
832
833
    ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
833
    ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
834
834
835
    is( $limit,q{(subject:biography)},"Limit correctly formed for ccl type query");
835
    is( $limit,q{((subject:biography))},"Limit correctly formed for ccl type query");
836
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
836
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
837
    is( $limit_desc,q{(subject:biography)},"Limit description is correctly handled for ccl type query");
837
    is( $limit_desc,q{((subject:biography))},"Limit description is correctly handled for ccl type query");
838
838
839
};
839
};
840
840
(-)a/t/db_dependent/Koha/SearchEngine/Zebra/QueryBuilder.t (-5 / +4 lines)
Lines 116-124 subtest "Handle search filters" => sub { Link Here
116
116
117
    my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
117
    my ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
118
118
119
    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");
119
    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");
120
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
120
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
121
    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");
121
    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");
122
122
123
    $filter = Koha::SearchFilter->new({
123
    $filter = Koha::SearchFilter->new({
124
        name => "test",
124
        name => "test",
Lines 129-136 subtest "Handle search filters" => sub { Link Here
129
129
130
    ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
130
    ( undef, undef, undef, undef, undef, $limit, $limit_cgi, $limit_desc ) = $qb->build_query_compat( undef, undef, undef, ["search_filter:$filter_id"] );
131
131
132
    is( $limit,q{(su=biography)},"Limit correctly formed for ccl type query");
132
    is( $limit,q{((su=biography))},"Limit correctly formed for ccl type query");
133
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
133
    is( $limit_cgi,"&limit=search_filter%3A$filter_id","CGI limit is not expanded");
134
    is( $limit_desc,q{(su=biography)},"Limit description is correctly handled for ccl type query");
134
    is( $limit_desc,q{((su=biography))},"Limit description is correctly handled for ccl type query");
135
135
136
};
136
};
137
- 

Return to bug 37333