hextra icon indicating copy to clipboard operation
hextra copied to clipboard

Work around flexsearch returning fewer than expected result pages.

Open bloovis opened this issue 3 months ago • 2 comments

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.

bloovis avatar Sep 29 '25 17:09 bloovis

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Sep 29 '25 17:09 netlify[bot]

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.

bloovis avatar Oct 06 '25 01:10 bloovis

This PR fixed the issue for me as well.

joeyundis-altra avatar Nov 17 '25 19:11 joeyundis-altra