-
I don't understand why the results in my site's search are generaly right, but they're not when I search for Here's the search: https://nicolas-hoizey.photo/search/?q=sphinx It finds this content, which is not relevant: https://nicolas-hoizey.photo/galleries/travels/europe/spain/andalusia/the-arch-from-once-upon-a-time-in-the-west-in-texas-hollywood/ But it doesn't find this one, which should be found: https://nicolas-hoizey.photo/galleries/animals/arthropods/insects/butterflies-and-moths/a-sphinx-moth-in-the-making/ Any advice on how to understand why the results are wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Ah, yes this is an interesting one. At the moment, Pagefind doesn't include metadata in the searchable index — they're two separate systems, essentially. In this case, your title:
Is outside your indexed body:
This puts it in the metadata, but not in the index. As a result, nothing is in the index with Fix here is to chuck a This is a common pitfall, so the longer term fix for Pagefind is #532 |
Beta Was this translation helpful? Give feedback.
Ah, yes this is an interesting one.
At the moment, Pagefind doesn't include metadata in the searchable index — they're two separate systems, essentially.
In this case, your title:
Is outside your indexed body:
This puts it in the metadata, but not in the index. As a result, nothing is in the index with
sphinx
, and Pagefind regresses your search term all the way back tos
to try find some result. (Possibly not the most helpful step, but Pagefind really likes giving some result over nothing).Fix here is to chuck a
data-pagefind-body
on your h1 as we…