Skip to content
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

Create Pagefind ranking playground #763

Open
bglw opened this issue Dec 18, 2024 · 2 comments
Open

Create Pagefind ranking playground #763

bglw opened this issue Dec 18, 2024 · 2 comments

Comments

@bglw
Copy link
Contributor

bglw commented Dec 18, 2024

Ranking is a bit of an opaque box at the moment, and making changes to the algorithm can be hard without good confidence in the end result.

The first step to being able to do this is to create some kind of ranking playground for Pagefind. The exact format of this is up for discussion, but at a minimum it should allow searching an example (or ideally user-supplied) index, while changing the ranking parameters live to see how they affect the results. It should also provide deeper debug information on the scoring for each result.

A while ago I set up a Rust playground containing the core essentials of the ranking, which can be seen here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=be766fc0ffe54b9981587d2a8fe6dafe

This playground allows us to change the code itself, which is useful, though it isn't a great space to visualize searches of a larger real-world index.

@juancampa
Copy link

This would be super helpful! I just spent some time tweaking our search results and ended up giving up. In part is because we're using @astro/starlight and the build/test cycle takes a little bit too long. Having a quick feedback loop would be awesome.

Something that would be useful to have in the playground is how the excerpts are determined. I was hoping that a term with weight 10 would be selected but that never worked, instead the <h1> term was always picked because it came back from the backend with a very high balanced_score.

I should say that it's possible that it's an issue with how @astro/starlight feeds pagefind though. I need to look into it.

@bglw
Copy link
Contributor Author

bglw commented Jan 19, 2025

The initial cut of the Playground exists on the latest alpha release — and has already revealed some changes I need to make 🎉

Anyone can explore the playground for the docs site here: https://unreleased.pagefind.app/pagefind/playground/

Something that would be useful to have in the playground is how the excerpts are determined

Good idea! I'll keep that one in mind. Excerpts don't currently use any of the weights, but I agree they should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants