From a821794a9184c6af7315bf632bedb7d30670bd0e Mon Sep 17 00:00:00 2001 From: koirand Date: Fri, 2 Nov 2018 02:17:26 +0900 Subject: [PATCH] Bug fix --- static/js/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/search.js b/static/js/search.js index b29d406..0dc81f6 100644 --- a/static/js/search.js +++ b/static/js/search.js @@ -66,7 +66,7 @@ function initUI () { function renderResults (results) { var $searchResults = $('#searchResults') var query = $('#searchBox').val() - var SUMMARY_INCLUDE = 100 + var SUMMARY_INCLUDE = 50 var MAX_PAGES = 10 // Clear search result @@ -84,7 +84,7 @@ function renderResults (results) { var matchPosition = result.body.indexOf(query.split(' ')[0]) var bodyStartPosition = matchPosition - SUMMARY_INCLUDE > 0 ? matchPosition - SUMMARY_INCLUDE : 0 $searchResultPage.append('' + result.title + '') - $searchResultPage.append('
' + result.body.substr(bodyStartPosition, SUMMARY_INCLUDE) + '
') + $searchResultPage.append('
' + result.body.substr(bodyStartPosition, SUMMARY_INCLUDE * 2) + '
') $searchResults.append($searchResultPage) // Highlight keyword