diff options
-rw-r--r-- | help3xsl/help.js | 14 | ||||
-rw-r--r-- | source/text/shared/05/new_help.xhp | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js index 48fdca8bb6..17d4909058 100644 --- a/help3xsl/help.js +++ b/help3xsl/help.js @@ -73,17 +73,29 @@ function fillIndex(indexEl, content, modules) { // filter the index list based on search field input function filter(indexList) { var results = null; + var group = []; var target = search.value.trim(); var filtered = ''; if (target.length < 1) { fillIndex(indexEl, fullLinks, modules); return; } + results = fuzzysort.go(target, bookmarks, {threshold: -15000, key:'text'}); + // tdf#123506 - Group the filtered list into module groups, keeping the ordering + modules.forEach(function(module) { + group[module] = ''; + }); results.forEach(function(result) { - filtered += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + fuzzysort.highlight(result) + '</a>'; + group[result.obj['app']] += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + fuzzysort.highlight(result) + '</a>'; }); + modules.forEach(function(module) { + if (group[module].length > 0) { + filtered += group[module]; + } + }); + fillIndex(indexList, filtered, modules); }; diff --git a/source/text/shared/05/new_help.xhp b/source/text/shared/05/new_help.xhp index b346ee7947..b55185eadc 100644 --- a/source/text/shared/05/new_help.xhp +++ b/source/text/shared/05/new_help.xhp @@ -43,7 +43,8 @@ <paragraph xml-lang="en-US" id="par_id3151351" role="paragraph">The Help Index displays a list of keywords for all %PRODUCTNAME modules. Click on any keyword in the list to open the linked Help page.</paragraph> <h3 id="hd_id151534901836252">Searching the Help Index</h3> <paragraph role="paragraph" id="par_id311534901893169" xml-lang="en-US">Type the keyword in the Search text box. The search is performed immediately, while you type the keyword.</paragraph> - <paragraph role="paragraph" id="par_id201534891524377" xml-lang="en-US">The search results is displayed as a filtered list of matches. The module name is displayed as a heading on the list. The <emph>GLOBAL</emph> heading indicates a match for keywords relevant to more than one %PRODUCTNAME module. For example, cell borders applies to spreadsheets cells as well as text and presentation table cells or frames.</paragraph> + <paragraph role="paragraph" id="par_id171632107583486" xml-lang="en-US">The search results are displayed as a filtered list of matches grouped by module name. The search results also include near matches. The matching parts of the search term are highlighted in each result.</paragraph> + <paragraph role="paragraph" id="par_id201534891524377" xml-lang="en-US">The <emph>GLOBAL</emph> heading indicates a match for keywords relevant to more than one %PRODUCTNAME module. For example, cell borders applies to spreadsheets cells as well as text and presentation table cells or frames.</paragraph> <paragraph role="paragraph" id="par_id261534891513315" xml-lang="en-US">Use the arrow icons on the bottom of the Index to scroll forward or backward the Index entries or filtered result list.</paragraph> </section> |