From ae030fcd49d800a2f070e8a029d69d1ac23fd7e4 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Fri, 31 Jan 2020 10:47:50 +0000 Subject: [PATCH] Bug 24555: add a button that shows ES query in search result Signed-off-by: Michal Denar --- catalogue/search.pl | 4 ++++ .../prog/en/modules/catalogue/results.tt | 24 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/catalogue/search.pl b/catalogue/search.pl index 882a9eb052..c42773a1a4 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -493,6 +493,10 @@ my $searcher = Koha::SearchEngine::Search->new( = $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits, \@sort_by, $scan, $lang, { weighted_fields => !$cgi->param('advsearch'), whole_record => $whole_record }); +use JSON; +my $json_query = JSON->new->pretty->encode($query); +$template->param( json_query => $json_query ); + ## parse the query_cgi string and put it into a form suitable for s my @query_inputs; my $scan_index_to_use; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index e618d73079..97ef2f8217 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -267,6 +267,10 @@ [% END %] + + @@ -284,6 +288,9 @@ [% ELSE %]

You did not specify any search criteria.

[% END %] + [% END # /IF total %] @@ -670,6 +677,23 @@ + + [% MACRO jsinclude BLOCK %] [% INCLUDE 'strings.inc' %] [% Asset.js("js/browser.js") | $raw %] -- 2.11.0