-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add custom weighting functionality #13
Comments
Some evolved thoughts: This could be handled at the tagging level, to achieve something like: <h1 data-pagefind-weight="2">More important text</h1>
<p>Normal text</p> |
Even just the ability to weight the title higher than the body text would be a very welcome addition! |
(Self note: related: #304) |
Hello to any watching 👋 I'm working toward a larger 1.0 release, but to anyone itching for this feature right now, you can use the latest Documentation for this feature here: https://unreleased.pagefind.app/docs/indexing/#ranking-content-higher-with-weights
I'll update this thread again on a 1.0 release 🙂 |
Thanks, this seems to be a useful addition, I think it'll solve some of my problems :D |
Hey @simonwiles & @fekete-robert ! 👋 Good news — this has landed in Pagefind v1.0.0! See the full release notes here: https://github.com/CloudCannon/pagefind/releases/tag/v1.0.0 💙 And the specific docs on weighting: https://pagefind.app/docs/weighting/ |
Thanks, that's great news! Now I'll just have to find the time to update our site to use it :) |
Could you please explain how it works i see no it in result version 1.03 you can try in here https://new.docs.victoriametrics.com/ |
Hey @tenmozes 👋 There are a a few signals that are all combined to rank the results, I can give some insight into the ranking here. Large single-page docs are a weak point right now for ranking. You can see some of the underlying ranking data if we run a search with the JS API on your site, using the term const pagefind = await import("/pagefind/pagefind.js");
const search = await pagefind.search("export time series");
const results = await Promise.all([...search.results.map(r => r.data())]); There's a lot of data so I won't paste it here, but you can dig into The biggest thing hurting you here will be that Pagefind ranks pages well if they have a higher frequency of matching words. The All of that is combined with some other signals to rank the results, which ultimately causes that homepage to be further down the list. There's a separate issue where Pagefind is less smart ranking the sub results within a page, which is why you see the homepage as the sixth result without the relevant heading shown. Ranking the sub results within a page needs to be smarter, as it doesn't currently take the weightings into account. I'll open an issue to get that work underway, it just didn't make it into the 1.0 cut |
Issue #437 discusses related topics, so that would also be a good place to continue any discussion! 🙂 |
This could involve:
h1
>p
)The text was updated successfully, but these errors were encountered: