On 2013-02-07 14:58, Pragyanshis Pattanaik wrote:
Hi,

Hi,

My schema is like below
<fields>
     <field name="ProductId" type="int" indexed="true" stored="true" />
     <field name="ProductName" type="string" indexed="true" stored="true" 
required="true" />
     <field name="ProductDesription" type="string" indexed="true" stored="true" 
required="true" />
     <field name="ProductRating" type="int" indexed="true" stored="true" 
required="true" />
</fields>

Product name will be passed as q parameter to solr.
Is there a way to affect score on the basis of "ProductRating" which is not 
passed as query parameter ?

You can use a boost function to achieve this.
There are examples in the wiki: <http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_change_the_score_of_a_document_based_on_the_.2Avalue.2A_of_a_field_.28say.2C_.22popularity.22.29>

A quick example:
defType=dismax&qf=text&q=supervillians&bf=sqrt(ProductRating)


Regards,
--
Jonas Birgander

Reply via email to