-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Feature: Pre-build search index #975
Comments
The lunr page on prebuilding indexes says the following:
In my case, I'm seeing 6-8 second delays before a page is usable on a fast computer. When using search, this makes it appear as though search is broken, since nothing happens after clicking enter to go to the next result. Users give up before the page can scroll to the result. |
@jtbayly rather than prebuild the index, I think it would be better to switch to fuse.js — I've done that in my experimental |
Is the bs4_book() format available somewhere for me to try it out? |
It's experimental, so no, it's not usable by others yet. |
I'd be very curious to see the code for how you integrated fuse.js. For that matter, I'd love to work on a replacement for the gitbook theme, since it doesn't work well on mobile. And I don't think any of the other formats have search built in, do they? |
You can see it in action at https://mastering-shiny.org. It's still very much a work in progress, but I think search is reasonably solid, and I've spent a decent amount of time making sure it works well on mobile. |
That seems fast, and I'm really liking the design. One criticism related to search: I think it makes a lot more sense to display a search results page than to just do a hover menu (or whatever that's called) with a few results. As it is, am I right in saying that you can only ever see 6 search results? I couldn't figure out how to go past the first 6 anyway. |
The six was just a bug; should be fixed momentarily. I don't think having a separate search page is that useful, especially given that I can't currently show any context for the search results. I'd maybe consider it if I could get that data out of fuse. |
Ah. I see. Working now. Yeah, if you can't provide additional context, then I guess there's not much point. |
Thanks for all your work on this! Super exciting! |
So, should this issue be retitled to "Switch to Fuse.js for search"? Edit, or Close it and start a new issue, I suppose. |
No, I think it can just be closed because the new |
So is the gitbook theme being deprecated for bs4_book? I mean, I’ve got an awful lot invested in gitbook, and it has quite a bit of functionality that is not available (yet?) in bs4_book. |
In resources/gitbook/js/plugin-search.js, there is the following comment:
I'm wondering if it is possible to add the ability (or even make it default) to pre-build the search index as mentioned above. I'm dealing with some books that are quite long, and every single page-load has a multi-second delay after load where the page is non-responsive as the search index gets rebuilt. Not surprisingly, it seems that processor gets slammed in the process, too.
By filing an issue to this repo, I promise that
xfun::session_info('bookdown')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/bookdown')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: