Question

First, I'm fairly new to solr and I'm far from sure that solr is the right solution to solve this problem. The documents that I'm working on is already there so, if solr can solve it, then it would be great :)

One of our fields in a document is of type string and have attribute multiValued set to true. It contains a list of id's that the current document relates to.

The task a head now is that I know have a second list of id's (same domain) and, if any of these id's matches (if more then one id matches then I want a higher score), then I would like to boost the score of the document.

Was it helpful?

Solution

Use Boost Query if you are using dismax or edismax.

For example, bq=id:1 OR id:2 OR id3 will boost documents which have at least one of the 3 ids. It will also give a higher boost to documents with more matching ids.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top