Work around flexsearch returning fewer than expected result pages.
This is my fix for the problem described in issue 714. I am a Javascript newbie (though I've been working in assembly language and C since 1976), so there are likely better ways to do things.
I also see that my commit comment doesn't follow the expected norms, which I was not aware of until 10 seconds ago.
Deploy Preview for hugo-hextra ready!
| Name | Link |
|---|---|
| Latest commit | f5aa5d7d97fba4fa63622cf29673760cac5d9155 |
| Latest deploy log | https://app.netlify.com/projects/hugo-hextra/deploys/68dabead7700ab000854eb3c |
| Deploy Preview | https://deploy-preview-847--hugo-hextra.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
As I mentioned in issue 714, if you pass a limit to the search of the sectionIndex, it limits the total number of section results for all pages, not just for that one page. This appears to be a bug in FlexSearch itself. That's why I don't use a limit, and because of the bug, I don't know how to set a sensible limit. Should it be 5 * maxPageResults? That's an arbitrary limit that might be wrong for pages that have more than 5 sections that match the search.
I realize this is a very strange bug, and it still makes my head hurt a little, but I don't know what else to do about it.
This PR fixed the issue for me as well.