display number of occurences of term

This commit is contained in:
Uwe Steinmann 2023-01-09 15:32:00 +01:00
parent 707082f6b6
commit bc5aa7703c
2 changed files with 2 additions and 10 deletions

View File

@ -96,13 +96,9 @@ function initMost() {
d.setFullYear(pastYear);
// console.log(d.toISOString().split('T')[0]);
// $.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
var data = {
query: query,
limit: 15,
// fullsearch: 1,
// creationdate: 1,
// createstart: d.toISOString().split('T')[0],
action: 'typeahead'
};
/* Return a list of json objects, each containing
@ -152,7 +148,7 @@ function initMost() {
else if(item.type.charAt(0) == 'F')
return '<i class="fa fa-folder-o"></i> ' + item.name.replace(/</g, '&lt;') + '<br /><span class="path">' + item.path + '</span>';
else
return '<i class="fa fa-search"></i> ' + item.name.replace(/</g, '&lt;');
return '<i class="fa fa-search"></i> ' + item.name.replace(/</g, '&lt;') + (item.occurences > 0 ? ' (' + item.occurences + ')' : '');
},
/* This only works with a modified version of bootstrap typeahead located
* in boostrap-typeahead.js Search for 'render'

View File

@ -101,13 +101,9 @@ function initMost() {
d.setFullYear(pastYear);
// console.log(d.toISOString().split('T')[0]);
// $.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
var data = {
query: query,
limit: 15,
// fullsearch: 1,
// creationdate: 1,
// createstart: d.toISOString().split('T')[0],
action: 'typeahead'
};
/* Return a list of json objects, each containing
@ -157,7 +153,7 @@ function initMost() {
else if(item.type.charAt(0) == 'F')
return '<i class="fa fa-folder-o"></i> ' + item.name.replace(/</g, '&lt;') + '<br /><span class="path">' + item.path + '</span>';
else
return '<i class="fa fa-search"></i> ' + item.name.replace(/</g, '&lt;');
return '<i class="fa fa-search"></i> ' + item.name.replace(/</g, '&lt;') + (item.occurences > 0 ? ' (' + item.occurences + ')' : '');
},
/* This only works with a modified version of bootstrap typeahead located
* in boostrap-typeahead.js Search for 'render'