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 Gian Marco Tagliani <gm...@gmail.com> on 2012/03/07 14:11:31 UTC

docBoost with "fq" search

Hi All,
I'm seeing strange behavior with my Solr (version 3.4).

For searching I'm using the "q" and the "fq" params.
At index-time I'm adding a docBoost to each document.

When I perform a search with both "q" and "fq" params everything works.
For the search with "q=*:*" and something in the "fq", it seems to me 
that the docBoost in not taken into consideration.

Is that possible?

Thanks

Re: docBoost with "fq" search

Posted by Ahmet Arslan <io...@yahoo.com>.
> if you store your boost in a search-able numeric field...

You can simply sort by that field too. q=*:*&sort=your_boost_field desc


Re: docBoost with "fq" search

Posted by Tanguy Moal <ta...@gmail.com>.
Hi Gian Marco,

I don't know if it's possible to exploit documents' boost values from 
function queries (see http://wiki.apache.org/solr/FunctionQuery), but if 
you store your boost in a search-able numeric field, you could either :
do

q=*:* AND _val_:"your_boost_field"

if you're using default query;

or

q=*:*&defType=edismax&bf=your_boost_field

if you're using edismax.

That will give scores to a MatchAllDocsQuery (*:*) .

Hope this helps,
--
Tanguy

Le 09/03/2012 10:25, Gian Marco Tagliani a écrit :
> Hi Ahmet,
> thanks for the answer.
>
> I'm really suprised because I always thought docBoost as a kind of sorting
> tool.
> And I used in that way, I'm giving big boost to the documents I want back
> first in search.
>
>
>
> Do you think there is a trick to force the usage of docBoost in my special
> case?
>
>
> Gian Marco
>
>
> On Wed, Mar 7, 2012 at 2:51 PM, Ahmet Arslan<io...@yahoo.com>  wrote:
>
>>
>> --- On Wed, 3/7/12, Gian Marco Tagliani<gm...@gmail.com>  wrote:
>>
>>> From: Gian Marco Tagliani<gm...@gmail.com>
>>> Subject: docBoost with "fq" search
>>> To: solr-user@lucene.apache.org
>>> Date: Wednesday, March 7, 2012, 3:11 PM
>>> Hi All,
>>> I'm seeing strange behavior with my Solr (version 3.4).
>>>
>>> For searching I'm using the "q" and the "fq" params.
>>> At index-time I'm adding a docBoost to each document.
>>>
>>> When I perform a search with both "q" and "fq" params
>>> everything works.
>>> For the search with "q=*:*" and something in the "fq", it
>>> seems to me that the docBoost in not taken into
>>> consideration.
>>>
>>> Is that possible?
>> Yes possible.
>>
>> FilterQuery (fq) does not contribute to score. It is not used in score
>> calculation.
>>
>> MatchAllDocsQuery (*:*) is a fast way to return all docs. Adding
>> &fl=score&debugQuery=on will show that all docs will get constant score of
>> 1.0.
>>


Re: docBoost with "fq" search

Posted by Gian Marco Tagliani <gm...@gmail.com>.
Hi Ahmet,
thanks for the answer.

I'm really suprised because I always thought docBoost as a kind of sorting
tool.
And I used in that way, I'm giving big boost to the documents I want back
first in search.



Do you think there is a trick to force the usage of docBoost in my special
case?


Gian Marco


On Wed, Mar 7, 2012 at 2:51 PM, Ahmet Arslan <io...@yahoo.com> wrote:

>
>
> --- On Wed, 3/7/12, Gian Marco Tagliani <gm...@gmail.com> wrote:
>
> > From: Gian Marco Tagliani <gm...@gmail.com>
> > Subject: docBoost with "fq" search
> > To: solr-user@lucene.apache.org
> > Date: Wednesday, March 7, 2012, 3:11 PM
> > Hi All,
> > I'm seeing strange behavior with my Solr (version 3.4).
> >
> > For searching I'm using the "q" and the "fq" params.
> > At index-time I'm adding a docBoost to each document.
> >
> > When I perform a search with both "q" and "fq" params
> > everything works.
> > For the search with "q=*:*" and something in the "fq", it
> > seems to me that the docBoost in not taken into
> > consideration.
> >
> > Is that possible?
>
> Yes possible.
>
> FilterQuery (fq) does not contribute to score. It is not used in score
> calculation.
>
> MatchAllDocsQuery (*:*) is a fast way to return all docs. Adding
> &fl=score&debugQuery=on will show that all docs will get constant score of
> 1.0.
>

Re: docBoost with "fq" search

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Wed, 3/7/12, Gian Marco Tagliani <gm...@gmail.com> wrote:

> From: Gian Marco Tagliani <gm...@gmail.com>
> Subject: docBoost with "fq" search
> To: solr-user@lucene.apache.org
> Date: Wednesday, March 7, 2012, 3:11 PM
> Hi All,
> I'm seeing strange behavior with my Solr (version 3.4).
> 
> For searching I'm using the "q" and the "fq" params.
> At index-time I'm adding a docBoost to each document.
> 
> When I perform a search with both "q" and "fq" params
> everything works.
> For the search with "q=*:*" and something in the "fq", it
> seems to me that the docBoost in not taken into
> consideration.
> 
> Is that possible?

Yes possible.

FilterQuery (fq) does not contribute to score. It is not used in score calculation. 

MatchAllDocsQuery (*:*) is a fast way to return all docs. Adding 
&fl=score&debugQuery=on will show that all docs will get constant score of 1.0.