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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-1 / +1 lines)
Lines 238-244 sub build_query_compat { Link Here
238
    #die Dumper($query);
238
    #die Dumper($query);
239
    # We roughly emulate the CGI parameters of the zebra query builder
239
    # We roughly emulate the CGI parameters of the zebra query builder
240
    my $query_cgi;
240
    my $query_cgi;
241
    $query_cgi = 'idx=kw&q=' . uri_escape_utf8( $operands->[0] ) if @$operands;
241
    $query_cgi = 'q=' . uri_escape_utf8( $operands->[0] ) if @$operands;
242
    my $simple_query;
242
    my $simple_query;
243
    $simple_query = $operands->[0] if @$operands == 1;
243
    $simple_query = $operands->[0] if @$operands == 1;
244
    my $query_desc   = $simple_query;
244
    my $query_desc   = $simple_query;
(-)a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t (-3 / +4 lines)
Lines 92-98 subtest 'json2marc' => sub { Link Here
92
};
92
};
93
93
94
subtest 'build_query tests' => sub {
94
subtest 'build_query tests' => sub {
95
    plan tests => 23;
95
    plan tests => 24;
96
96
97
    t::lib::Mocks::mock_preference('DisplayLibraryFacets','both');
97
    t::lib::Mocks::mock_preference('DisplayLibraryFacets','both');
98
    my $query = $builder->build_query();
98
    my $query = $builder->build_query();
Lines 232-243 subtest 'build_query tests' => sub { Link Here
232
        "query of specific field is added AND suppress:0"
232
        "query of specific field is added AND suppress:0"
233
    );
233
    );
234
234
235
    ( undef, $query ) = $builder->build_query_compat( undef, ['title:"donald duck"'], undef, undef, undef, undef, undef, { suppress => 0 } );
235
    my ($simple_query, $query_cgi);
236
    ( undef, $query, $simple_query, $query_cgi ) = $builder->build_query_compat( undef, ['title:"donald duck"'], undef, undef, undef, undef, undef, { suppress => 0 } );
236
    is(
237
    is(
237
        $query->{query}{query_string}{query},
238
        $query->{query}{query_string}{query},
238
        '(title:"donald duck")',
239
        '(title:"donald duck")',
239
        "query of specific field is not added AND suppress:0"
240
        "query of specific field is not added AND suppress:0"
240
    );
241
    );
242
    is($query_cgi, 'q=title%3A%22donald%20duck%22', 'query cgi');
241
};
243
};
242
244
243
subtest "_convert_sort_fields" => sub {
245
subtest "_convert_sort_fields" => sub {
244
- 

Return to bug 21032