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 MitchK <mi...@web.de> on 2010/08/02 01:17:48 UTC

Re: Boosting DisMax queries with !boost component

Hi,

qf needs to have spaces in it, unfortunately the local query parser can not
deal with that, as Erik Hatcher mentioned some months ago.

A solution would be to do something like that:

{!dismax%20qf=$yourqf}yourQuery&yourgf=title^1.0 tags^2.0

Since you are using the dismax-query-parser, you can add the boosting query
via bq-param.

Hope this helps,
- Mitch
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Boosting-DisMax-queries-with-boost-component-tp1011294p1014242.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Boosting DisMax queries with !boost component

Posted by MitchK <mi...@web.de>.

Jonathan Rochkind wrote:
> 
>> qf needs to have spaces in it, unfortunately the local query parser can
>> not
>> deal with that, as Erik Hatcher mentioned some months ago.
> 
> By "local query parser", you mean what I call the LocalParams stuff (for
> lack of being sure of the proper term)?  
> 
Yes, that was what I meant.

Kind regards,
- Mitch
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Boosting-DisMax-queries-with-boost-component-tp1011294p1015619.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Boosting DisMax queries with !boost component

Posted by Jonathan Rochkind <ro...@jhu.edu>.
> qf needs to have spaces in it, unfortunately the local query parser can not
> deal with that, as Erik Hatcher mentioned some months ago.

By "local query parser", you mean what I call the LocalParams stuff (for lack of being sure of the proper term)?  You can put spaces in there, you just need to put it in quotes (single or double). I've been doing it with no problems.  I forget if backslash-escaping is also possible there, it may be, but that would get extra confusing if you have a nested query AND local params, which is my case. But using single quotes for one and double for the other works fine:

Your q equals the URI encoded form of:  _query_: "{!dismax qf='something^10 other^100'}some query"

Ie:

 &q=_query_%3A%22%7B%21dismax+qf%3D%27something%5E10+other%5E100%27%7Dsome+query%22%29

Can get confusing to make sure you've got all the escaping right, especially when you're constructing the query in software that itself needs to have quotes escaped, but it works fine if you get it all right. Mitch's suggestion may indeed be less confusing if there's no reason in your context not to use it (there was in mine). 

> {!dismax%20qf=$yourqf}yourQuery&yourgf=title^1.0 tags^2.0

Jonathan