0

I have a query similar to this:

http://solr1:8983/solr/select?defType=lucenePlusSort&fl=pk_i,score&json.nl=map&qt=standard&rows=36&sort=&start=0&wt=json&q=type_s:Product+AND+is_valid_b:true

I need to boost the results where user_id_i:(123 OR 222 OR 512 OR 932)

something like => __val_:"if(user_id_i:(123 OR 222 OR 512 OR 932), 100, 0)"

But obviously I need a function that returns true or false for that particular question.

Razvan
  • 43
  • 5

1 Answers1

0

I think you can use the boost query parameter for this, but you will have to use the edismax query parser and not the lucenePlusSort one. (http://wiki.apache.org/solr/ExtendedDisMax#boost_.28Boost_Function.2C_multiplicative.29)

[boost] => product(if(exists(query({!v='user_id_i:(123 OR 222 OR 512 OR 932)'})),100,1))

Ovidiu
  • 51
  • 5
  • Was really hoping on not having to migrate to edismax but I couldn't find any solution to use this with luceneplussort – Razvan Mar 03 '15 at 15:48