Bugzilla – Attachment 98248 Details for
Bug 24555
POC Elasticsearch - Use boolean queries instead of full text queries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24555: add a button that shows ES query in search result
Bug-24555-add-a-button-that-shows-ES-query-in-sear.patch (text/plain), 3.35 KB, created by
Michal Denar
on 2020-01-31 20:32:39 UTC
(
hide
)
Description:
Bug 24555: add a button that shows ES query in search result
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2020-01-31 20:32:39 UTC
Size:
3.35 KB
patch
obsolete
>From ae030fcd49d800a2f070e8a029d69d1ac23fd7e4 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >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 <black23@gmail.com> >--- > 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 <input>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 %] > </ul> > </div> <!-- /.btn-group --> >+ >+ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="modal" aria-haspopup="true" aria-expanded="false" data-target="#searchDebug"> >+ ES query >+ </button> > </div> <!-- /#selection_ops --> > </div> <!-- /#searchheader --> > >@@ -284,6 +288,9 @@ > [% ELSE %] > <p>You did not specify any search criteria.</p> > [% END %] >+ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="modal" aria-haspopup="true" aria-expanded="false" data-target="#searchDebug"> >+ Search debug >+ </button> > </div> > [% END # /IF total %] > >@@ -670,6 +677,23 @@ > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > </div> <!-- /.row --> > >+ <div class="modal fade" id="searchDebug" tabindex="-1" role="dialog" aria-labelledby="Search debug"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="myModalLabel">ES query</h4> >+ </div> >+ <div class="modal-body"> >+ <pre>[% json_query %]</pre> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> >+ </div> >+ </div> >+ </div> >+ </div> >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24555
:
98242
|
98243
|
98247
| 98248 |
104419
|
104422
|
105061
|
105470
|
105471
|
105472
|
105744