lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Boost query syntax error
Date Mon, 03 Mar 2014 21:28:12 GMT

: But this query does not work:
: 
: q={!boost
: b=if(exists(query({!v='user_type:ADMIN'})),10,1)}id:1&rows=1&fl=*,score
: It gives an error like this:

The problem is the way you are trying to nest queries inside of each other 
w/o any sort of quoting -- the parser has no indication that the "b" param 
is "if(exists(query({!v='user_type:ADMIN'})),10,1)" it thinks it' 
"if(exists(query({!v='user_type:ADMIN'" and the rest is confusing it.

If you quote the "b" param to the boost parser, then it should work...

http://localhost:8983/solr/select?q={!boost%20b=%22if%28exists%28query%28{!v=%27foo_s:ADMIN%27}%29%29,10,1%29%22}id:1

...or if you could use variable derefrencing, either of these should 
work...

http://localhost:8983/solr/select?q={!boost%20b=$b}id:1&b=if%28exists%28query%28{!v=%27foo_s:ADMIN%27}%29%29,10,1%29
http://localhost:8983/solr/select?q={!boost%20b=if(exists(query($nestedq)),10,1)}id:1&nestedq=foo_s:ADMIN


-Hoss
http://www.lucidworks.com/

Mime
View raw message