You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by smita <ne...@gmail.com> on 2012/06/14 22:40:20 UTC

How to boost a field with another field's value?

I have 2 fields in my schema - e.g. 

long field "field1" and long field "field 2".
I'd like my boost query to be such that field1 is boosted by the value of
field 2 for each document.
What should the query time boost for this look like? I was able to do this
using Index time boosting with the DataImportHandler, but couldn't figure
out how to do this using query time boosting.

Thanks!

--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-boost-a-field-with-another-field-s-value-tp3989706.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to boost a field with another field's value?

Posted by smita <ne...@gmail.com>.
Actually I have a title field that I am searching for my query term, and the
documents have a rating field that I want to boost the results by, so the
higher rated items appear before the lower rated documents.

I am also boosting results on another field using bq:

q=summer&df=title&bq=sponsored:true^5.0&qf=rating^2.0&defType=dismax

However, when I use qf to boost the results by rating, Sorl is trying to
match the query in the rating field. How can I accomplish boosting by rating
using query time boosting?





--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-boost-a-field-with-another-field-s-value-tp3989706p3989917.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to boost a field with another field's value?

Posted by Jack Krupansky <ja...@basetechnology.com>.
See "Function Query":
http://wiki.apache.org/solr/FunctionQuery

If you are using the dismax or edismax query parser you can use the "bf" 
request parameter.

e.g.,

    q=foo&bf="ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3"

-- Jack Krupansky

-----Original Message----- 
From: smita
Sent: Thursday, June 14, 2012 4:40 PM
To: solr-user@lucene.apache.org
Subject: How to boost a field with another field's value?

I have 2 fields in my schema - e.g.

long field "field1" and long field "field 2".
I'd like my boost query to be such that field1 is boosted by the value of
field 2 for each document.
What should the query time boost for this look like? I was able to do this
using Index time boosting with the DataImportHandler, but couldn't figure
out how to do this using query time boosting.

Thanks!

--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-boost-a-field-with-another-field-s-value-tp3989706.html
Sent from the Solr - User mailing list archive at Nabble.com.