question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boost a single field

See original GitHub issue

Is 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:closed
  • Created 6 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
olivernncommented, May 20, 2017

@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.

6reactions
olivernncommented, May 15, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found