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 Alex Grilo <al...@umamao.com> on 2011/06/08 15:22:02 UTC

Problem with boosting function

Hi,
I'm trying to use bf parameter in solr queries but I'm having some problems.

The context is: I have some topics and a integer weight of popularity
(number of users that follow the topic). I'd like to boost the documents
according to this weight field, and it changes (users may start following or
unfollowing that topic). I through the best way to do that is adding a bf
parameter to the query.

First of all I was trying to include it in a query processed by a default
SearchHandler. I debugged the results and the scores didn't change. So I
tried to change the defType of the SearchHandler to dismax (I didn't add any
other field in solrconfig), and queries didn't work anymore.

What is the best way to achieve what I want? Do I really need to use a
dismax SearchHander (I read about it, and I don't want to search in multple
fields - I want to search in one field and boost in another one)?

Thanks in advance

Alex Grilo

Re: Problem with boosting function

Posted by Denis Kuzmenok <fo...@ukr.net>.
try:

q=title:Unicamp&defType=dismax&bf=question_count^5.0
"title:Unicamp" in any search handler will search only in requested field

> The queries I am trying to do are
> q=title:Unicamp

> and

> q=title:Unicamp&bf=question_count^5.0

> The boosting factor (5.0) is just to verify if it was really used.

> Thanks

> Alex




Re: Problem with boosting function

Posted by Alex Grilo <al...@umamao.com>.
The queries I am trying to do are
q=title:Unicamp

and

q=title:Unicamp&bf=question_count^5.0

The boosting factor (5.0) is just to verify if it was really used.

Thanks

Alex

On Wed, Jun 8, 2011 at 10:25 AM, Denis Kuzmenok <fo...@ukr.net> wrote:

> Show your full request to solr (all params)
>
> > Hi,
> > I'm trying to use bf parameter in solr queries but I'm having some
> problems.
>
> > The context is: I have some topics and a integer weight of popularity
> > (number of users that follow the topic). I'd like to boost the documents
> > according to this weight field, and it changes (users may start following
> or
> > unfollowing that topic). I through the best way to do that is adding a bf
> > parameter to the query.
>
> > First of all I was trying to include it in a query processed by a default
> > SearchHandler. I debugged the results and the scores didn't change. So I
> > tried to change the defType of the SearchHandler to dismax (I didn't add
> any
> > other field in solrconfig), and queries didn't work anymore.
>
> > What is the best way to achieve what I want? Do I really need to use a
> > dismax SearchHander (I read about it, and I don't want to search in
> multple
> > fields - I want to search in one field and boost in another one)?
>
> > Thanks in advance
>
> > Alex Grilo
>
>
>

Re: Problem with boosting function

Posted by Denis Kuzmenok <fo...@ukr.net>.
Show your full request to solr (all params)

> Hi,
> I'm trying to use bf parameter in solr queries but I'm having some problems.

> The context is: I have some topics and a integer weight of popularity
> (number of users that follow the topic). I'd like to boost the documents
> according to this weight field, and it changes (users may start following or
> unfollowing that topic). I through the best way to do that is adding a bf
> parameter to the query.

> First of all I was trying to include it in a query processed by a default
> SearchHandler. I debugged the results and the scores didn't change. So I
> tried to change the defType of the SearchHandler to dismax (I didn't add any
> other field in solrconfig), and queries didn't work anymore.

> What is the best way to achieve what I want? Do I really need to use a
> dismax SearchHander (I read about it, and I don't want to search in multple
> fields - I want to search in one field and boost in another one)?

> Thanks in advance

> Alex Grilo



Re: Problem with boosting function

Posted by Yonik Seeley <yo...@lucidimagination.com>.
The boost qparser should do the trick if you want a multiplicative boost.
http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html

-Yonik
http://www.lucidimagination.com



On Wed, Jun 8, 2011 at 9:22 AM, Alex Grilo <al...@umamao.com> wrote:
> Hi,
> I'm trying to use bf parameter in solr queries but I'm having some problems.
>
> The context is: I have some topics and a integer weight of popularity
> (number of users that follow the topic). I'd like to boost the documents
> according to this weight field, and it changes (users may start following or
> unfollowing that topic). I through the best way to do that is adding a bf
> parameter to the query.
>
> First of all I was trying to include it in a query processed by a default
> SearchHandler. I debugged the results and the scores didn't change. So I
> tried to change the defType of the SearchHandler to dismax (I didn't add any
> other field in solrconfig), and queries didn't work anymore.
>
> What is the best way to achieve what I want? Do I really need to use a
> dismax SearchHander (I read about it, and I don't want to search in multple
> fields - I want to search in one field and boost in another one)?
>
> Thanks in advance
>
> Alex Grilo
>