简体   繁体   中英

Solr filter queries and boosting

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

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