Boost a single field
See original GitHub issueIs it possible to boost a field in the search (v2)?
Example:
On the demo page, https://olivernn.github.io/moonwalkers/ , if I search two fields like this: name:pete^10 body:pete
, I expect the result which has a match on the name field to come first. However, the result with the match in the body comes first.
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
How do I boost a potentially existing field in Elasticsearch?
It will search all fields in all indices for the words "lorem" and "ipsum" ... hit if those words were both found in...
Read more >boost | Elasticsearch Guide [7.17]
Individual fields can be boosted automatically — count more towards the relevance score — at query time, with the boost parameter as follows:....
Read more >Field (Lucene 6.5.1 API)
Returns the field's index-time boost. Only fields can have an index-time boost, if you want to simulate a "document boost", then you must...
Read more >Use an entity field value as custom boost factor
I like the idea of adding a keywords field with a high boost. Only issue here is that there's weight to distinguish between...
Read more >Boost Rules
IDOL applies the boost rule only to users that have the specified value in the explicit user fields for that user. You can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Andargor this part of the interface has changed since 2.0.0, this is covered in the upgrading guide.
That said, with the changes discussed earlier in this thread, it should be possible to bring back this feature, allowing build time boosts for certain fields again.
I’ve got a good idea whats going wrong here and I think I’ve got a solution. Specifically it is to do with how lunr is treating documents, currently there is just a single vector space model for the entire document. With field search it really needs to have a vector space of each individual field. I have a rough implementation of this locally and it performs much better with field based searches.
I’m just trying to figure out a way of testing the relevancy of search results in an automated, repeatable manner. This is tricky to get right. I’ve found some resources from a now defunct apache project that might be useful in assessing how good the relevancy of lunr is before and after this change. Basically, I want to be able to see the impact on changing the scoring algorithms within lunr.
Anyway, long story short, I think I’ve got a good solution to this issue, I just need to make sure it doesn’t negatively impact any other kind of searches.