@@ -, +, @@ --- .../Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t +++ a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t @@ -216,7 +216,7 @@ subtest 'build_authorities_query_compat() tests' => sub { }; subtest 'build_query tests' => sub { - plan tests => 56; + plan tests => 57; my $qb; @@ -279,6 +279,13 @@ subtest 'build_query tests' => sub { "query not altered if QueryAutoTruncate disabled" ); + ( undef, $query ) = $qb->build_query_compat( undef, ['donald duck'], ['kw,phr'] ); + is( + $query->{query}{query_string}{query}, + '("donald duck")', + "keyword as phrase correctly quotes search term and strips index" + ); + ( undef, $query ) = $qb->build_query_compat( undef, ['donald duck'], ['title'] ); is( $query->{query}{query_string}{query}, --