easyops-cn / docusaurus-search-local

Offline/local search for Docusaurus v2/v3
https://easyops-cn.github.io/docusaurus-search-local/
MIT License
717 stars 93 forks source link

Huge Search Index #351

Open deepaksood619 opened 1 year ago

deepaksood619 commented 1 year ago

Site - http://deepaksood619.github.io/

Whenever I type anything on search, the whole search index file of 11 MB is downloaded locally, before it can search.

Can we have incremental search suggestions like first level index can only be direct page names, next level can be title or headers, and then the content.

This can be configurable too

weareoutman commented 5 months ago

This is known as the biggest caveat of using front-end based search. Generally we have to download all the search index files to accomplish the search work.

Your suggested approach may have some improvement on user experience, but there is a high chance that it has to download all index files.

The proper solution may be using node.js to do the search job on the sever side, instead.

mzbrau commented 6 days ago

Another suggestion might, if possible, to pre-load the search-index.json file in the background after the docs site has loaded. That way it would be ready when the user starts to search and they wouldn't need to wait for the background download to occur on demand.