[Koha-bugs] [Bug 30141] ElasticsearchCrossFields enabled returns no search results on OPAC

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 24 22:12:33 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30141

Shi Yao Wang <shi-yao.wang at inLibro.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shi-yao.wang at inLibro.com

--- Comment #1 from Shi Yao Wang <shi-yao.wang at inLibro.com> ---
It may be due to ES boolean statements not being evaluated correctly?
Possible fix.

diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
index dba475eb3c..5934956326 100644
--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
@@ -306,6 +306,7 @@ sub build_query_compat {
         # them into a structured ES query itself. Maybe later, though that'd
be
         # more robust.
         $search_param_query_str = join( ' ',
$self->_create_query_string(@search_params) );
+        $search_param_query_str = "($search_param_query_str)";
         $query_str = join( ' AND ',
             $search_param_query_str || (),
             $self->_join_queries( $self->_convert_index_strings(@$limits) ) ||
() );

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list