Open skrysmanski opened 9 months ago
Correct on all counts (that this is currently intended, but isn't desirable). I'm hoping that part of #437 will involve bringing more metadata into the search index, but it needs a little bit of care to support use-cases where other metadata explicitly shouldn't be searchable.
Since this issue captures it more generally, I'll keep both around and track the overall ability to search metadata here 🙂
(Possibly helpful context for why this isn't a simple toggle: Currently the metadata only exists in the final page fragment that is loaded when showing a result. The metadata doesn't exist at the time of querying, so the index itself will need to change to implement this feature)
I've noticed that Pagefind doesn't seem to find pages where the search terms just appear in the title - if it's outside
data-pagefind-body
.Basically I have pages like this:
In my example, the words "cheat sheet" don't appear in the actual article but just in the title.
If I now search for "cheat sheet" (with the Default UI), Pagefind doesn't find this page.
My workaround is to also add
data-pagefind-body
to the<h1>
element but in my opinion this shouldn't be necessary.This problem probably extends to all meta data.