简体   繁体   中英

What happens in Solr when a document field does/doesn't match a term in boost query (bq)?

I was wondering how to interpret boost query. I know if a document has a match on a boost like bq=name:"bob"^5 then it will be given a higher ranking, but in general if you have many terms with different fields what happens when a given document field doesn't match the value?

Is this term in the bq just "dropped" and ignored? Is this to say if you had something like bq=name:"bob"^5 location:"Boston"2 but only name matched on a document then it would receive a score of 5, but a score of 7 if both matched? I've read the docs but I'm still having trouble making sense of this.

Thanks for any insight!

From The Documentation

The bq (Boost Query) Parameter
The bq parameter specifies an additional, optional, query clause that will be added to the user's main query to influence the score.

So If some of the documents do not match the term in boost query, Then that specific documents will not get excluded from the result set. They only get the lower score in comparison to the others. Because boost query will only influence the score.

Now if we look at the below boost query.

bq=name:"bob"^5 location:"Boston"2

Well, the documents which matched both queries get more score in the comparison of the others documents which only match one. It will not be simple math calculation like (5+2) = 7. But some score according to Lucene scoring calculation method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM