-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to search for fewer than 3 characters. #2014
Comments
As I understand it, in most cases a search of less than 3 characters is not going to result in useful results, thus the default. However, there are some specific cases where a 2 character search could be useful. But those cases are relatively few and not a high priority for us. That being the case, we would be willing to consider a PR which added a config option to the search plugin, but otherwise are not likely to get to this feature anytime soon. |
Thanks Waylan - I'll see if I can put together a respectable looking PR tomorrow. |
Pull request 2018 now raised which changes the default message displayed if the search term was too short (but leaves the 'No results message' alone if there were actually no results returned). The PR doesn't address the idea of making the minimum search length configurable, but it will be sufficient for our needs to stop our users getting confused. |
As a reminder, a significant reason for the character limit is for the "live update" feature which some themes make use of. As an example, the In contrast, other themes, such as the Perhaps this should be a theme option, which would also be user overridable. Or a plugin option would be a reasonable alternative. However, returning a message as a search result is not the right way to handle this. If you want to alter the "no results" default, then that would be something to take to the theme you are using. |
Pull request now updated to handle taking a parameter |
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.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.
The text was updated successfully, but these errors were encountered: