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 Mark Roberts <ma...@red-gate.com> on 2010/03/09 16:31:05 UTC

Dummy boost question

Hi, 

I have indexed some documents that have title, content and keyword (multi-value).

I want to *search* on title and content, and then, within these results *boost* by keyword.

I have set up my qf as such:

      <str name="qf">
        content^0.5 title^1.0
      </str>

And my bq as such:

	<str name="bq">keyword:(*.*)^1.0</str>

But I'm fairly sure that this is boosting on all keywords (not just ones matching my search term)

Does anyone know how to achieve what I want (I'm using the DisMax query request handler btw.)


Thanks!
Mark 

Re: Dummy boost question

Posted by Chris Hostetter <ho...@fucit.org>.
: I want to *search* on title and content, and then, within these results *boost* by keyword.
	...
: 	<str name="bq">keyword:(*.*)^1.0</str>
: 
: But I'm fairly sure that this is boosting on all keywords (not just ones matching my search term)

correct.

: Does anyone know how to achieve what I want (I'm using the DisMax query request handler btw.)

Hmmmm... 

you could use the "pf" param to specify your keywords field (if you aren't 
already) so that queries where the entire search string match the keyword 
field are boosted (it's not clear to me if that's what you want or not)

Alternately, you could specify the "bq" at query time and copy your search 
terms into it .... actually ... i've never tried it, but something like 
this might work...

   <str name="bq">{!lucene df=keyword v=$q}</str>

...that should the Local Params "derefrencing" feature to use the "q" 
param as the value of the of the bq param (typically it's used to bake 
localparams in the config while pulling some other param from the request 
-- but i can't think of any reason why you can't use it to access "q" 
directly.



-Hoss