This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/accumulo-website.git
The following commit(s) were added to refs/heads/asf-site by this push: new 213bb4ea Automatic Site Publish by Buildbot 213bb4ea is described below commit 213bb4ea250b5694329600e8ed87260ae622a588 Author: buildbot <us...@infra.apache.org> AuthorDate: Wed Aug 30 12:50:02 2023 +0000 Automatic Site Publish by Buildbot --- output/feed.xml | 4 ++-- output/js/search.js | 61 ++++++++++++++++++++++++------------------------ output/search/index.html | 6 ++--- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/output/feed.xml b/output/feed.xml index c0ba5d4b..3898e86d 100644 --- a/output/feed.xml +++ b/output/feed.xml @@ -6,8 +6,8 @@ </description> <link>https://accumulo.apache.org/</link> <atom:link href="https://accumulo.apache.org/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Thu, 24 Aug 2023 07:35:14 +0000</pubDate> - <lastBuildDate>Thu, 24 Aug 2023 07:35:14 +0000</lastBuildDate> + <pubDate>Wed, 30 Aug 2023 12:49:55 +0000</pubDate> + <lastBuildDate>Wed, 30 Aug 2023 12:49:55 +0000</lastBuildDate> <generator>Jekyll v4.3.2</generator> diff --git a/output/js/search.js b/output/js/search.js index 5501f85a..2c6b1076 100644 --- a/output/js/search.js +++ b/output/js/search.js @@ -1,48 +1,47 @@ -jQuery(function() { +jQuery(function () { - window.idx = lunr(function () { - this.field('id'); - this.field('title'); - this.field('content', { boost: 10 }); - this.field('categories'); - }); + $.getJSON('/search_data.json').then(function (loaded_data) { - window.data = $.getJSON('/search_data.json'); + window.idx = lunr(function () { + this.field('id'); + this.field('title'); + this.field('content', { boost: 10 }); + this.field('categories'); - window.data.then(function(loaded_data){ - $.each(loaded_data, function(index, value){ - window.idx.add($.extend({ "id": index }, value)); + for (var index in loaded_data) { + this.add($.extend({ "id": index }, loaded_data[index])); + } }); - }); - $("#site_search").submit(function(event){ + $("#site_search").submit(function (event) { event.preventDefault(); var query = $("#search_box").val(); var results = window.idx.search(query); - display_search_results(query, results); + display_search_results(query, results, loaded_data); + }); + }); - function display_search_results(query, results) { + function display_search_results(query, results, loaded_data) { var $search_status = $("#search_status"); var $search_results = $("#search_results"); - window.data.then(function(loaded_data) { - - if (results.length) { - $search_status.html('Found ' + results.length + ' results for "' + query + '"'); - $search_results.empty(); - results.forEach(function(result) { - var item = loaded_data[result.ref]; - var n = item.content.search(query) - 50 - if (n < 0) { - n = 0; - } - var appendString = '<tr><td><a href="' + item.url + '">' + item.title + '</a><td>' + item.content.substring(n, n+100) + '</tr>'; - $search_results.append(appendString); - }); - } else { - $search_status.html('No results found!'); + if (!results.length) { + $search_status.html('No results found!'); + return; + } + + $search_status.html('Found ' + results.length + ' results for "' + query + '"'); + $search_results.empty(); + results.forEach(function (result) { + var item = loaded_data[result.ref]; + var n = item.content.search(query) - 50 + if (n < 0) { + n = 0; } + var appendString = '<tr><td><a href="' + item.url + '">' + item.title + '</a><td>' + item.content.substring(n, n + 100) + '</tr>'; + $search_results.append(appendString); }); + } }); diff --git a/output/search/index.html b/output/search/index.html index a537fb51..169ece7d 100644 --- a/output/search/index.html +++ b/output/search/index.html @@ -162,11 +162,9 @@ <div id="search_status"></div> -<table class="table table-striped" id="search_results"></table> +<table class="table table-striped"><tbody id="search_results"></tbody></table> -<script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/1.0.0/lunr.min.js"></script> - -<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> +<script src="https://unpkg.com/lunr@2.3.9/lunr.min.js"></script> <script src="/js/search.js"></script>