开发者

Solr filter queries and boosting

开发者 https://www.devze.com 2023-03-26 12:51 出处:网络
Is it possible to boost fields that appear in filter queries (fq=) in Solr? I have a faceted query that has a tagged filter query something like this:

Is it possible to boost fields that appear in filter queries (fq=) in Solr?

I have a faceted query that has a tagged filter query something like this:

...&q=*:*&fq={!tag:X}brand:(+"4911")+OR+body:(abc)&facet.field={!ex:X}brand&..

(I facet on brand and the facet is set to ignore the filter query tagged X, so I need to use a filter query.)

I would like to make matches on the brand field score higher than matches on body field in the filter query.

The fields brand an开发者_StackOverflowd body are multivalued.

I've tried adding bf=/bq= arguments, and I can get brand matches to score higher if I change the filter query to be the main 'q=' query, but I don't seem to be able to influence the score of anything in the filter query. I think I maybe going about it in the wrong way..

Thanks.


Solr "fq"'s do not affect score -- see the wiki. So, you should add your queries to "q" that you actually want to boost. If need be, you can always duplicate a query restriction in both "q" and "fq", as "fq" only acts as a restriction on the results set.

0

精彩评论

暂无评论...
验证码 换一张
取 消