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

Add support for defining lunr similarity tuning parameters and custom search boost factors #67

Merged
merged 3 commits into from
Dec 3, 2021

Conversation

JulesBlm
Copy link

Hi, thanks for this great package. I needed to tweak the lunr similarity tuning parameters and boosts slightly to improve the search results. This PR add supports for defining these (parameters b and k1) and boost factors for title and content matches in the lunr field in the config options. The defaults are the same as they used to be: b = 0.75, k1 = 1.2, titleBoost = 5, and contentBoost = 1.

All tests pass and some testing with my docs showed that my search results got better.

Jules-VIKTOR and others added 3 commits December 3, 2021 18:57
- Add support for defining similarity tuning parameters b, and k1
- Add support for defining boost factors for content and titles
@cmfcmf
Copy link
Owner

cmfcmf commented Dec 3, 2021

Thank you @JulesBlm, and sorry for the delay!
I made some minor changes and also made the boost of parent categories configurable.
Could you share the settings you ended up using for your docs? Maybe the current defaults (especially the boost values) are not the best they could be.

@cmfcmf cmfcmf merged commit 6a29110 into cmfcmf:main Dec 3, 2021
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

Successfully merging this pull request may close these issues.

3 participants