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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (+1 lines)
Lines 306-311 sub build_query_compat { Link Here
306
        # them into a structured ES query itself. Maybe later, though that'd be
306
        # them into a structured ES query itself. Maybe later, though that'd be
307
        # more robust.
307
        # more robust.
308
        $search_param_query_str = join( ' ', $self->_create_query_string(@search_params) );
308
        $search_param_query_str = join( ' ', $self->_create_query_string(@search_params) );
309
        $search_param_query_str = "($search_param_query_str)";
309
        $query_str = join( ' AND ',
310
        $query_str = join( ' AND ',
310
            $search_param_query_str || (),
311
            $search_param_query_str || (),
311
            $self->_join_queries( $self->_convert_index_strings(@$limits) ) || () );
312
            $self->_join_queries( $self->_convert_index_strings(@$limits) ) || () );
(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t (-2 / +8 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 13;
20
use Test::More tests => 14;
21
use t::lib::Mocks;
21
use t::lib::Mocks;
22
22
23
use Koha::SearchEngine::Elasticsearch::QueryBuilder;
23
use Koha::SearchEngine::Elasticsearch::QueryBuilder;
Lines 84-89 is( $searcher->index, 'mydb', 'Testing basic accessor' ); Link Here
84
84
85
ok( my $query = $builder->build_query('easy'), 'Build a search query');
85
ok( my $query = $builder->build_query('easy'), 'Build a search query');
86
86
87
my (undef, $or_query) = $builder->build_query_compat( ['OR'], ['a', 'b'], undef, ['mc-itype:c'] );
88
is(
89
    $or_query->{query}->{query_string}->{query},
90
    '((a*) OR (b*)) AND itype:("c")',
91
    'Testing OR query with limit'
92
);
93
87
SKIP: {
94
SKIP: {
88
95
89
    eval { $builder->get_elasticsearch_params; };
96
    eval { $builder->get_elasticsearch_params; };
90
- 

Return to bug 30152