diff --git a/themes/openpowerfoundation/assets/js/search.js b/themes/openpowerfoundation/assets/js/search.js index 77297bf..30df17a 100644 --- a/themes/openpowerfoundation/assets/js/search.js +++ b/themes/openpowerfoundation/assets/js/search.js @@ -1,4 +1,4 @@ -summaryInclude=0; +summaryInclude=100; var fuseOptions = { shouldSort: true, includeMatches: true, @@ -9,9 +9,9 @@ var fuseOptions = { maxPatternLength: 32, minMatchCharLength: 1, keys: [ - { name: "title" , weight: 0.8 }, + { name: "title" , weight: 0.9 }, + { name: "tags" , weight: 0.7 }, { name: "contents" , weight: 0.5 }, - { name: "tags" , weight: 0.3 }, { name: "categories" , weight: 0.3 } ] }; @@ -62,10 +62,10 @@ function populateResults(result){ if(mvalue.key == "tags" || mvalue.key == "categories") { snippetHighlights.push(mvalue.value); } else if(mvalue.key == "contents") { - start = mvalue.indices[0][0]-summaryInclude>0?mvalue.indices[0][0]-summaryInclude:0; - end = mvalue.indices[0][1]+summaryInclude0?mvalue.indices[0][0]-summaryInclude:0; + end = mvalue.indices[0][1]+summaryInclude