-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
One of our mkdocs sites contains details about IBM MQ, but currently our users are telling us that they cannot find any documentation because when they search for 'MQ' it comes back saying 'No Results Found'.
There appears to be a hardcoded minimum search length configured in the doSearch() function within contrib/search/templates/search/main.js. If the search term query.length is >2 then the search is done, but if not then empty results are displayed instead. This is misleading - If the search is too short then a message should be displayed to indicate that is the reason why no results are available.
function doSearch () {
var query = document.getElementById('mkdocs-search-query').value;
if (query.length > 2) {
if (!window.Worker) {
displayResults(search(query));
} else {
searchWorker.postMessage({query: query});
}
} else {
// Clear results for short queries
displayResults([]);
}
}
It would be really great to have a config parameter so that the minimum search length could be configured, but even without that, having a useful message appear to let users know that their search was too short would be really helpful for us - it would save us from having to answer the phone a few times a week to point people in the right direction.