feat: add configurable limit to search results

Signed-off-by: Navendu Pottekkat <navendu@apache.org>
This commit is contained in:
Navendu Pottekkat
2023-08-08 00:16:15 +05:30
parent 69cec7a0ba
commit e71444b776

View File

@ -77,7 +77,7 @@ sInput.onkeyup = function (e) {
// run a search query (for "term") every time a letter is typed
// in the search box
if (fuse) {
const results = fuse.search(this.value.trim()); // the actual query being run using fuse.js
const results = fuse.search(this.value.trim(), {limit: params.fuseOpts.limit}); // the actual query being run using fuse.js
if (results.length !== 0) {
// build our html if result exists
let resultSet = ''; // our results bucket