The elevation component will be a ton of manual work. Instead, use edismax and 
the boost parameter.

Add a field that is true for paid documents, then boost for paid:true. It might 
be easier to use a boost query (bq) to do this. The extra boost will be a 
tiebreaker for documents that would have the same score.

Use this in your solrconfig.xml:

    <str name=“bq”>paid:true</str> 

You can add weight to that if it isn’t boosting the paid content enough. Like 
this:

    <str name=“bq”>paid:true^8</str> 

It is slightly better to do this with the boost parameter and a function query, 
because that bypasses idf, but I think this approach is nice and clear.

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Nov 5, 2015, at 3:33 AM, Alessandro Benedetti <abenede...@apache.org> 
> wrote:
> 
> Hi Christian,
> there are several ways :
> 
> 1) Elevation query component - it should be your winner :
> https://cwiki.apache.org/confluence/display/solr/The+Query+Elevation+Component
> 
> 2) Play with boosting according to your requirements
> 
> Cheers
> 
> On 5 November 2015 at 10:52, <liviuchrist...@yahoo.com.invalid> wrote:
> 
>> Hi everyone,I'm building a food recipe search engine based on solr.
>> 
>> I need to boost documents score for the recipes that their authors paid
>> for in order to have them returned first when somebody searches for
>> "chocolate cake with hazelnuts". So those recipes that match the query
>> terms and their authors paid to be listed first need to be returned first,
>> ahead of the unpaid ones that match the query.
>> 
>> How do I do that in Solr?
>> PLEASE HELP!
>> Regards,
>> Christian
>> 
>> 
> 
> 
> -- 
> --------------------------
> 
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
> 
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
> 
> William Blake - Songs of Experience -1794 England

Reply via email to