From 4a6a71b08f3cadf482fff792c0725cbfcbc3a0fd Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 5 Sep 2014 22:17:01 +0100 Subject: [PATCH] add debug feature and minor tweaks to es integration --- es.js | 4 ++-- jquery.reportview.js | 9 ++++++++- rv_example.html | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/es.js b/es.js index b895988..718eab7 100644 --- a/es.js +++ b/es.js @@ -243,10 +243,10 @@ function elasticSearchQuery(params) { } // paging (number of results, and start cursor) - if (options.from) { + if (options.from !== undefined) { qs["from"] = options.from } - if (options.page_size) { + if (options.page_size !== undefined) { qs["size"] = options.page_size } diff --git a/jquery.reportview.js b/jquery.reportview.js index 547a78c..6674942 100644 --- a/jquery.reportview.js +++ b/jquery.reportview.js @@ -100,7 +100,11 @@ function theReportview(options) { */ // the reportview object to be appended to the page - var thereportview = '
'; + var thereportview = '
' + if (options.debug) { + thereportview += "
" + } + thereportview += '
'; return thereportview } @@ -287,6 +291,9 @@ function renderMultiBar(params) { // to the must filter "fixed_filters" : false, + // size of result set + "page_size" : 0, + ///// internal state monitoring ///////////////////////////// // these are used internally DO NOT USE diff --git a/rv_example.html b/rv_example.html index bae6258..08b0543 100644 --- a/rv_example.html +++ b/rv_example.html @@ -101,6 +101,7 @@ $('#report-view-bar-facet').each(function() { $(this).report({ + debug: true, type: "multibar", search_url: "http://localhost:9200/doaj/article/_search", facets: [