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

Js extended database #4

Open
yekayra opened this issue Feb 17, 2019 · 1 comment
Open

Js extended database #4

yekayra opened this issue Feb 17, 2019 · 1 comment

Comments

@yekayra
Copy link

yekayra commented Feb 17, 2019

Dear Developer(s)
I use your codes in my mobile app. You helped me to much.
Nowadays I have a new problem. In your "search.html" example lunr_index.js database must be fully loaded to search and this slows down searching. My database is about 15 mb and it will get bigger and bigger in time. Will you help me to solve this problem. In my opinion, For increasing search speed, lunr_index.js database would be load after clicking search. (Sorry for my English).
Thanks in advance.

@twhiteaker
Copy link
Collaborator

There are several possible solutions. One is to load the search index asynchronously and only show or enable the search button once the index is loaded. You could also employ a number of other performance enhancing techniques such as prefetching the index. Here's an article with some performance enhancing ideas.

But 15 MB is awfully big, especially if you are serving mobile users. If you are indexing the full content of each page, consider just indexing the meta description instead. That should save considerable space. Just make sure your descriptions include the likely keywords that users would enter to discover each page.

If you've already done all that you can to shrink the index and it's still 15 MB, then it may be time to consider employing a search-as-a-service solution like Elasticsearch or Algolia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants