When OpacSuppression is active, you can't search using Elasticsearch. The error shown is: Unable to perform your search. Please try again. By adding a die we coaxed it into a better error message: Can't use string ("(HASH(0xcfe2548)) not Suppress=1") as a HASH ref while "strict refs" in use at /home/katrin/kohaclone/Koha/SearchEngine/Elasticsearch/Search.pm line 99.
Created attachment 60727 [details] [review] Bug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder To test: OPAC: Both SearchEngine "Elasticsearch" and "Zebra" should work with OpacSuppression set to "yes" NB: OPAC suppression is not implemented for Elasticsearch
I still get the same "unable to perform your search" error for elasticsearch even with patch applied.
Hi Claire, Can you please have a look at https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18189 , I believe you are experiencing the same thing.
Actually that was nonsense. Is your search engine set to Zebra please?
(In reply to Srdjan Jankovic from comment #4) > Actually that was nonsense. Is your search engine set to Zebra please? It was set to elasticsearch and I had turned on the OpacSuppression preference for testing. Without this system preference the search was working with no error message.
Claire, would you be able to have a look at the log file and tell me what is the error please?
We are experiencing the same problem. Here is the error we get: Can't use string ("(HASH(0x55fc9bc7b880)) not Suppr"...) as a HASH ref while "strict refs" in use at /usr/local/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 100. at /usr/local/koha/circ/returns.pl line 36. CGI::Compile::ROOT::usr_local_koha_circ_returns_2epl::__ANON__("Can't use string (\"(HASH(0x55fc9bc7b880)) not Suppr\"...) as a"...) called at /usr/local/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 100 eval {...} called at /usr/local/koha/Koha/SearchEngine/Elasticsearch/Search.pm line 99 Koha::SearchEngine::Elasticsearch::Search::search(Koha::SearchEngine::Elasticsearch::Search=HASH(0x55fc9b9f1e10), "(HASH(0x55fc9bc7b880)) not Suppress=1", undef, 20, "offset", 0, "expanded_facet", undef) called at /usr/local/koha/Ko ha/SearchEngine/Elasticsearch/Search.pm line 154 Koha::SearchEngine::Elasticsearch::Search::search_compat(Koha::SearchEngine::Elasticsearch::Search=HASH(0x55fc9b9f1e10), "(HASH(0x55fc9bc7b880)) not Suppress=1", "hamlet, kronborg", ARRAY(0x55fc99192378), ARRAY(0x55fc99988690), 20, 0, undef, ...) called at /usr/local/koha/opac/opac-search.pl line 616 eval {...} called at /usr/local/koha/opac/opac-search.pl line 615 eval {...} called at /usr/local/koha/opac/opac-search.pl line 2 CGI::Compile::ROOT::usr_local_koha_opac_opac_2dsearch_2epl::__ANON__(CGI::Compile=HASH(0x55fc974af3c0), "", "/usr/local/koha/opac/opac-search.pl", "/usr/local/koha/opac", ARRAY(0x55fc9be6db90)) called at /usr/local/share/perl/5.24.1 /CGI/Compile.pm line 139 CGI::Compile::__ANON__() called at /usr/local/share/perl/5.24.1/CGI/Emulate/PSGI.pm line 30 CGI::Emulate::PSGI::__ANON__(HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/App/WrapCGI.pm line 90 Plack::App::WrapCGI::call(Plack::App::WrapCGI=HASH(0x55fc991463f8), HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/App/CGIBin.pm line 50 Plack::App::CGIBin::serve_path(Plack::App::CGIBin=HASH(0x55fc96114c18), HASH(0x55fc9ba4ba30), "/usr/local/koha/opac/opac-search.pl") called at /usr/local/share/perl/5.24.1/Plack/App/File.pm line 34 Plack::App::File::call(Plack::App::CGIBin=HASH(0x55fc96114c18), HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/App/URLMap.pm line 71 Plack::App::URLMap::call(Plack::App::URLMap=HASH(0x55fc96114d20), HASH(0x55fc9ba4ba30)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9ba4ba30)) called at /usr/local/koha/Koha/Middleware/SetEnv.pm line 103 Koha::Middleware::SetEnv::call(Koha::Middleware::SetEnv=HASH(0x55fc97227fa8), HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Middleware/Static.pm line 18 Plack::Middleware::Static::call(Plack::Middleware::Static=HASH(0x55fc97228248), HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Middleware/ReverseProxy.pm line 68 Plack::Middleware::ReverseProxy::call(Plack::Middleware::ReverseProxy=HASH(0x55fc972284d0), HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Middleware/AccessLog.pm line 27 Plack::Middleware::AccessLog::call(Plack::Middleware::AccessLog=HASH(0x55fc8e5ac3f8), HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Component.pm line 50 Plack::Component::__ANON__(HASH(0x55fc9b690658)) called at /usr/local/share/perl/5.24.1/Plack/Util.pm line 145 eval {...} called at /usr/local/share/perl/5.24.1/Plack/Util.pm line 145 Plack::Util::run_app(CODE(0x55fc8e5acde8), HASH(0x55fc9b690658)) called at /usr/share/perl5/Starman/Server.pm line 195 Starman::Server::dispatch_request(Starman::Server=HASH(0x55fc8df42128), HASH(0x55fc9b690658)) called at /usr/share/perl5/Starman/Server.pm line 298 Starman::Server::process_request(Starman::Server=HASH(0x55fc8df42128), Net::Server::Proto::UNIX=GLOB(0x55fc9bb2db20)) called at /usr/local/share/perl/5.24.1/Net/Server.pm line 72 Net::Server::run_client_connection(Starman::Server=HASH(0x55fc8df42128)) called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 225 eval {...} called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 225 Net::Server::PreFork::run_child(Starman::Server=HASH(0x55fc8df42128)) called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 183 Net::Server::PreFork::run_n_children(Starman::Server=HASH(0x55fc8df42128), 1) called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 373 Net::Server::PreFork::coordinate_children(Starman::Server=HASH(0x55fc8df42128)) called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 327 Net::Server::PreFork::run_parent(Starman::Server=HASH(0x55fc8df42128)) called at /usr/share/perl5/Starman/Server.pm line 164 Starman::Server::run_parent(Starman::Server=HASH(0x55fc8df42128)) called at /usr/local/share/perl/5.24.1/Net/Server/PreFork.pm line 109 Net::Server::PreFork::loop(Starman::Server=HASH(0x55fc8df42128)) called at /usr/local/share/perl/5.24.1/Net/Server.pm line 58 Net::Server::run(Starman::Server=HASH(0x55fc8df42128), "port", ARRAY(0x55fc8e4db780), "host", "*", "proto", "tcp", "serialize", ...) called at /usr/share/perl5/Starman/Server.pm line 106 Starman::Server::run(Starman::Server=HASH(0x55fc8df42128), CODE(0x55fc8df41ff0), HASH(0x55fc8df41db0)) called at /usr/share/perl5/Plack/Handler/Starman.pm line 25 Plack::Handler::Starman::run(Plack::Handler::Starman=HASH(0x55fc8df42008), CODE(0x55fc8df41ff0)) called at /usr/local/share/perl/5.24.1/Plack/Loader/Delayed.pm line 20 Plack::Loader::Delayed::run(Plack::Loader::Delayed=HASH(0x55fc8dd79678), Plack::Handler::Starman=HASH(0x55fc8df42008)) called at /usr/local/share/perl/5.24.1/Plack/Runner.pm line 277 Plack::Runner::run(Plack::Runner=HASH(0x55fc8dd0c378)) called at /usr/bin/starman line 38 Is someone looking into this?
Hi Frank, When I apply the patch I don't get the error. Are you positive you have the patch applied please?
(In reply to Srdjan Jankovic from comment #8) > Hi Frank, > When I apply the patch I don't get the error. Are you positive you have the > patch applied please? Thank's, the patch works for me.
Created attachment 68224 [details] [review] Bug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder To test: OPAC: Both SearchEngine "Elasticsearch" and "Zebra" should work with OpacSuppression set to "yes" NB: OPAC suppression is not implemented for Elasticsearch Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Created attachment 68280 [details] [review] Bug 16660 - Add support for OpacSuppression to Elasticsearch To test: 1 - Enable suppression 2 - Suppress some records 3 - Apply all the patches 4 - Reindex ES 5 - Search and don't get suppressed records 6 - Disable suppression 7 - Search and get all the records
Created attachment 68320 [details] [review] Bug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder To test: OPAC: Both SearchEngine "Elasticsearch" and "Zebra" should work with OpacSuppression set to "yes" NB: OPAC suppression is not implemented for Elasticsearch Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68321 [details] [review] Bug 16660: Add support for OpacSuppression to Elasticsearch To test: 1 - Enable suppression 2 - Suppress some records 3 - Apply all the patches 4 - Reindex ES 5 - Search and don't get suppressed records 6 - Disable suppression 7 - Search and get all the records Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68322 [details] [review] Bug 16660: (followup) Unit tests This patch adds unit tests for the introduced changes in build_query_compat. It removes a warning too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 68704 [details] [review] Bug 16660: Moved Opac Supression filtering from opac-search.pl to Zebra::QueryBuilder To test: OPAC: Both SearchEngine "Elasticsearch" and "Zebra" should work with OpacSuppression set to "yes" NB: OPAC suppression is not implemented for Elasticsearch Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 68705 [details] [review] Bug 16660: Add support for OpacSuppression to Elasticsearch To test: 1 - Enable suppression 2 - Suppress some records 3 - Apply all the patches 4 - Reindex ES 5 - Search and don't get suppressed records 6 - Disable suppression 7 - Search and get all the records Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 68706 [details] [review] Bug 16660: (followup) Unit tests This patch adds unit tests for the introduced changes in build_query_compat. It removes a warning too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 17.11, thanks to everybody involved!
Too tuchy to push now in 17.05.x