Some more experiments have helped me answer my own questions.

> Q1. Can anyone confirm whether bf and bq can both 
> be used together in solrconfig.xml?
yes

> Q3. Can I have multiple bq parameters? If so, do I 
> space-separate them as a single bq, or provide 
> multiple BQs?
Yes, multiple bq parameters work, space-separating multiple query terms
in a single bq also works.

Here's a snippet of my solrconfig.xml:

<str name="bq">published_date_d:[NOW-3MONTHS/DAY TO NOW/DAY+1DAY]^5.2 OR
(published_date_d:[NOW-12MONTHS/DAY TO NOW/DAY+1DAY] AND
report_type_id_i:10000004)^10.0 OR (published_date_d:[NOW-6MONTHS/DAY TO
NOW/DAY+1DAY] AND is_printed_b:true)^4.0</str>
<str name="bq">is_mp_parent_b:false^10.0</str>
<str name="bf">recip(rord(published_date_d),20,5000,5)^5.5</str>


-----Original Message-----
From: Dean Missikowski (Consultant), CLSA 
Sent: 08/03/2009 12:01 PM
To: solr-user@lucene.apache.org
Subject: Query Boosting using both BQ and BF 

Hi,

I have a couple of questions related to query boosting using the dismax
request handler. I'm using a recent 1.4 build (to take advantage of
omitTf), and have also tried all of this with 1.3.

To apply a query-time boost to the previous 3 months of documents in my
index I use:

<str name="bq">published_date_d:[NOW-3MONTHS/DAY TO NOW/DAY+1DAY]^10.2
</str>

And, to provide a boosting that helps rank recently documents higher I
use:
<str name="bf">recip(rord(published_date_d),20,5000,5)^5.5</str>

This seems to be working well.

But I have more boosting requirements.  For example, I need to boost
documents that are tagged as printed. So, I tried to add another bq
parameter:

<str name="bq">is_printed_b:true^4.0</str>

Also, tried to append this space-separated all in one bq parameter like
this:
<str name="bq">published_date_d:[NOW-3MONTHS/DAY TO NOW/DAY+1DAY]^10.2
is_printed_b:true^4.0</str> 

Lastly, I need to apply a negative boost to documents of a certain type,
so I use:
<str name="bq">-is_mp_parent_b:true^50.0</str>

Not sure if it matters, but I have <solrQueryParser
defaultOperator="AND"/> in schema.xml 

None of those variations return expected results (it's like the bq is
being applied as a filter instead of just applying boosts).

Q1. Can anyone confirm whether bf and bq can both be used together in
solrconfig.xml?
Q2. Is there a way I can do ths using only BF? How? 
Q3. Can I have multiple bq parameters? If so, do I space-separate them
as a single bq, or provide multiple BQs?
Q3. Am I formulating my BQs that use Boolean fields correctly?

Any help or insights much appreciated,

Thanks Dean

CLSA CLEAN & GREEN: Please consider our environment before printing this email.
The content of this communication is subject to CLSA Legal and Regulatory 
Notices. 
These can be viewed at https://www.clsa.com/disclaimer.html or sent to you upon 
request.


Reply via email to