Skip to content
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

Run search only for query having 3 and more characters #1127

Closed
davidhrbac opened this issue Jan 20, 2017 · 2 comments · Fixed by #1418
Closed

Run search only for query having 3 and more characters #1127

davidhrbac opened this issue Jan 20, 2017 · 2 comments · Fixed by #1418
Assignees
Milestone

Comments

@davidhrbac
Copy link
Contributor

We have quite a large search_index.json - 2.2MB. The search is very slow. How can we limit the search to start only for queries having 3 and more characters?

@waylan
Copy link
Member

waylan commented Jan 20, 2017

Is search slow all the time or only the first time after a new page is loaded?

If it is the former, then this is a duplicate of #859. If the latter, then this will likely be addressed by that issue anyway as I intend to do a complete refactor of search allowing users to customize the features available in the underlying library. The holdup is that search will be moved to a Plugin and we need to finish the Plugin API first (see #206). Either way, I'll leave this open to remind me to possibly include this as one of the config options.

@waylan waylan added this to the 1.0.0 milestone Jan 20, 2017
@waylan waylan self-assigned this Jan 20, 2017
@davidhrbac
Copy link
Contributor Author

@waylan the first is definitely slow. Anyway there's no point to let JS search the large base for single or two characters. It might return very large set (hundreds, even more). Thanks.

@waylan waylan added the Plugin label Nov 1, 2017
waylan added a commit to waylan/mkdocs that referenced this issue Jan 31, 2018
waylan added a commit to waylan/mkdocs that referenced this issue Feb 27, 2018
waylan added a commit that referenced this issue Mar 6, 2018
* Use a web worker in the browser with a fallback (fixes #859 & closes #1396).
* Optionally pre-build search index (fixes #859 & closes #1061).
* Upgrade to lunr.js 2.x (fixes #1319).
* Support search in languages other than English (fixes #826).
* Allow the user to define the word separators (fixes #867).
* Only run searches for queries of length > 2 (fixes #1127).
* Remove dependency on require.js, mustache, etc. (fixes #1218).
* Compress the search index (fixes #1128).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants