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 "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com> on 2014/04/10 20:49:11 UTC

Relevance/Rank

Hi  I am looking boosting to help if I can achieve the Rank equal to MS SQL Server.

I have a query something like 

&fq=(SKU:123-87458) OR  Name:" 123-87458"

I need to get the Exact Match as first in the results, In this case SKU. But also I can change to display Name in the List which is not exact match but match , the value can be find some where in the Name?

In Simple I can Rank SKU as 1 and Name as 2 for some customer and some customer Rank Name as 1 and SKU as 2 in the results.

Is this Possible , I tried Boosting but that it seems it is for Text, correct me if I am wrong on understanding and any example will be really appreciated. I am getting confused after going thru different sites.


Thanks


Re: Relevance/Rank

Posted by Shawn Heisey <so...@elyograg.org>.
On 4/10/2014 12:49 PM, EXTERNAL Taminidi Ravi (ETI, 
Automotive-Service-Solutions) wrote:
> Hi  I am looking boosting to help if I can achieve the Rank equal to MS SQL Server.
>
> I have a query something like
>
> &fq=(SKU:123-87458) OR  Name:" 123-87458"
>
> I need to get the Exact Match as first in the results, In this case SKU. But also I can change to display Name in the List which is not exact match but match , the value can be find some where in the Name?
>
> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some customer Rank Name as 1 and SKU as 2 in the results.
>
> Is this Possible , I tried Boosting but that it seems it is for Text, correct me if I am wrong on understanding and any example will be really appreciated. I am getting confused after going thru different sites.

Your query is being sent with the fq parameter.  Filter queries do not 
affect scoring at all.  They are purely for filtering.  You would need 
to move this to the q parameter (query) in order for what's there to 
affect relevancy ranking.

You will very likely want to look over this:

https://wiki.apache.org/solr/SolrRelevancyFAQ

Thanks,
Shawn


Re: Relevance/Rank

Posted by Upayavira <uv...@odoko.co.uk>.
Looks to me that the original query was using the lucene query parser,
whereas bq is a parameter of the edismax query parser. This means that
the bq param is being ignored.

Move the fq clause to the q param, and add ^2000 after the name:123-444
bit.

Upayavira 

On Fri, Apr 11, 2014, at 06:03 PM, EXTERNAL Taminidi Ravi (ETI,
Automotive-Service-Solutions) wrote:
> HI thanks Aman/Eric,
> 
> I move part of the query under q=*:* and there is a difference in the
> score and the Order. It seems work for me now. I use this and move
> forward
> 
> Thanks
> 
> Ravi
> 
> -----Original Message-----
> From: Aman Tandon [mailto:amantandon.10@gmail.com] 
> Sent: Friday, April 11, 2014 12:02 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Relevance/Rank
> 
> Its fine Erick, I am guessing that maybe* &fq=(SKU:204-161)...  *this SKU
> with that value is present in all results that's why Name products are
> not getting boosted.
> 
> Ravi: check your results without filtering, does all the results include
> *SKU:204-161.
> *I guess this may help.
> 
> 
> On Fri, Apr 11, 2014 at 9:22 AM, Erick Erickson
> <er...@gmail.com>wrote:
> 
> > Aman:
> >
> > Oops, looked at the wrong part of the query, didn't see the bq clause.
> > You're right of course. Sorry for the misdirection.
> >
> > Erick
> >
> 
> 
> 
> --
> With Regards
> Aman Tandon

RE: Relevance/Rank

Posted by "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com>.
HI thanks Aman/Eric,

I move part of the query under q=*:* and there is a difference in the score and the Order. It seems work for me now. I use this and move forward

Thanks

Ravi

-----Original Message-----
From: Aman Tandon [mailto:amantandon.10@gmail.com] 
Sent: Friday, April 11, 2014 12:02 AM
To: solr-user@lucene.apache.org
Subject: Re: Relevance/Rank

Its fine Erick, I am guessing that maybe* &fq=(SKU:204-161)...  *this SKU with that value is present in all results that's why Name products are not getting boosted.

Ravi: check your results without filtering, does all the results include *SKU:204-161.
*I guess this may help.


On Fri, Apr 11, 2014 at 9:22 AM, Erick Erickson <er...@gmail.com>wrote:

> Aman:
>
> Oops, looked at the wrong part of the query, didn't see the bq clause.
> You're right of course. Sorry for the misdirection.
>
> Erick
>



--
With Regards
Aman Tandon

Re: Relevance/Rank

Posted by Aman Tandon <am...@gmail.com>.
Its fine Erick, I am guessing that maybe* &fq=(SKU:204-161)...  *this SKU
with that value is present in all results that's why Name products are not
getting boosted.

Ravi: check your results without filtering, does all the results
include *SKU:204-161.
*I guess this may help.


On Fri, Apr 11, 2014 at 9:22 AM, Erick Erickson <er...@gmail.com>wrote:

> Aman:
>
> Oops, looked at the wrong part of the query, didn't see the bq clause.
> You're right of course. Sorry for the misdirection.
>
> Erick
>



-- 
With Regards
Aman Tandon

Re: Relevance/Rank

Posted by Erick Erickson <er...@gmail.com>.
Aman:

Oops, looked at the wrong part of the query, didn't see the bq clause.
You're right of course. Sorry for the misdirection.

Erick

Re: Relevance/Rank

Posted by Aman Tandon <am...@gmail.com>.
Hello Erick,

I am confused here, how does the boosting will not affect if he is boosting
the name products by 20000 because he is filtering the results and then
applying the boost.


On Fri, Apr 11, 2014 at 6:12 AM, Aman Tandon <am...@gmail.com>wrote:

> Hi Ravi,
>
> For the better analysis for ranking of documents, you should need to query
> the index with these extra parameters(in bold)
> eg...whole_query*&debug=true&wt=xml.*
> Copy that xml and and paste it to http://explain.solr.pl/ you can then
> easily find out the ranking alalysis in the forms of the pie charts and how
> much weight is giving to every parameters in your solr config and in the
> query.
>
>
>
>
> On Fri, Apr 11, 2014 at 5:56 AM, Erick Erickson <er...@gmail.com>wrote:
>
>> What Shawn said. q=*:* is a "constant score query", i.e. every match
>> has a score as 1.0.
>> fq clauses don't contribute to the score. The boosts you're specifying
>> have absolutely no effect.
>> Move the fq clause to your main query (q=) to see any effect.
>> Try adding &debug=all to your query and look at the explanation of how
>> the score is calculated, I suspect you'll find them all 1.0.
>>
>> Best,
>> Erick
>>
>> On Thu, Apr 10, 2014 at 12:53 PM, EXTERNAL Taminidi Ravi (ETI,
>> Automotive-Service-Solutions) <ex...@us.bosch.com>
>> wrote:
>> > Eric, Below is the query part
>> >
>> >
>> select?q=*:*&fq={!join%20from=SKU%20to=SKU%20fromIndex=Collection2}(CatalogName:*Products)&fq=(SKU:204-161)%20OR%20(Name:%22204-161%22)&bq=Name:%22204-161%22^20000
>> > I am not getting the Name Match record in the first list , I am getting
>> always SKU matching Record.
>> >
>> > Any help is really appreciated.
>> >
>> > Thanks
>> >
>> > Ravi
>> >
>> > -----Original Message-----
>> > From: Erick Erickson [mailto:erickerickson@gmail.com]
>> > Sent: Thursday, April 10, 2014 3:35 PM
>> > To: solr-user@lucene.apache.org
>> > Subject: Re: Relevance/Rank
>> >
>> > What kind of field is "Name"? Assuming it's string, you should be able
>> to boost it. Boosts are not relevant to filters (fq) clauses at all, where
>> were you trying to add the boost?
>> >
>> > You need to provide significantly more information to get a more
>> helpful answer. You might review:
>> >
>> > http://wiki.apache.org/solr/UsingMailingLists
>> >
>> > bq:  I am getting confused after going thru different sites.
>> >
>> > You're in luck, the Solr Reference Guide
>> > (
>> https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide
>> )
>> > is becoming the collected source of information. Also, here's a
>> sorely-needed set of up-to-date info:
>> > http://www.manning.com/grainger/, and Jack Krupansky is publishing an
>> e-book here: http://www.lulu.com/spotlight/JackKrupansky (this is the
>> last link I have, there may be more recent copies).
>> >
>> > Best,
>> > Erick
>> >
>> > On Thu, Apr 10, 2014 at 11:49 AM, EXTERNAL Taminidi Ravi (ETI,
>> > Automotive-Service-Solutions) <ex...@us.bosch.com>
>> > wrote:
>> >>
>> >> Hi  I am looking boosting to help if I can achieve the Rank equal to
>> MS SQL Server.
>> >>
>> >> I have a query something like
>> >>
>> >> &fq=(SKU:123-87458) OR  Name:" 123-87458"
>> >>
>> >> I need to get the Exact Match as first in the results, In this case
>> SKU. But also I can change to display Name in the List which is not exact
>> match but match , the value can be find some where in the Name?
>> >>
>> >> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some
>> customer Rank Name as 1 and SKU as 2 in the results.
>> >>
>> >> Is this Possible , I tried Boosting but that it seems it is for Text,
>> correct me if I am wrong on understanding and any example will be really
>> appreciated. I am getting confused after going thru different sites.
>> >>
>> >>
>> >> Thanks
>> >>
>>
>
>
>
> --
> With Regards
> Aman Tandon
>



-- 
With Regards
Aman Tandon

Re: Relevance/Rank

Posted by Aman Tandon <am...@gmail.com>.
Hi Ravi,

For the better analysis for ranking of documents, you should need to query
the index with these extra parameters(in bold)
eg...whole_query*&debug=true&wt=xml.*
Copy that xml and and paste it to http://explain.solr.pl/ you can then
easily find out the ranking alalysis in the forms of the pie charts and how
much weight is giving to every parameters in your solr config and in the
query.




On Fri, Apr 11, 2014 at 5:56 AM, Erick Erickson <er...@gmail.com>wrote:

> What Shawn said. q=*:* is a "constant score query", i.e. every match
> has a score as 1.0.
> fq clauses don't contribute to the score. The boosts you're specifying
> have absolutely no effect.
> Move the fq clause to your main query (q=) to see any effect.
> Try adding &debug=all to your query and look at the explanation of how
> the score is calculated, I suspect you'll find them all 1.0.
>
> Best,
> Erick
>
> On Thu, Apr 10, 2014 at 12:53 PM, EXTERNAL Taminidi Ravi (ETI,
> Automotive-Service-Solutions) <ex...@us.bosch.com>
> wrote:
> > Eric, Below is the query part
> >
> >
> select?q=*:*&fq={!join%20from=SKU%20to=SKU%20fromIndex=Collection2}(CatalogName:*Products)&fq=(SKU:204-161)%20OR%20(Name:%22204-161%22)&bq=Name:%22204-161%22^20000
> > I am not getting the Name Match record in the first list , I am getting
> always SKU matching Record.
> >
> > Any help is really appreciated.
> >
> > Thanks
> >
> > Ravi
> >
> > -----Original Message-----
> > From: Erick Erickson [mailto:erickerickson@gmail.com]
> > Sent: Thursday, April 10, 2014 3:35 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Relevance/Rank
> >
> > What kind of field is "Name"? Assuming it's string, you should be able
> to boost it. Boosts are not relevant to filters (fq) clauses at all, where
> were you trying to add the boost?
> >
> > You need to provide significantly more information to get a more helpful
> answer. You might review:
> >
> > http://wiki.apache.org/solr/UsingMailingLists
> >
> > bq:  I am getting confused after going thru different sites.
> >
> > You're in luck, the Solr Reference Guide
> > (
> https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide
> )
> > is becoming the collected source of information. Also, here's a
> sorely-needed set of up-to-date info:
> > http://www.manning.com/grainger/, and Jack Krupansky is publishing an
> e-book here: http://www.lulu.com/spotlight/JackKrupansky (this is the
> last link I have, there may be more recent copies).
> >
> > Best,
> > Erick
> >
> > On Thu, Apr 10, 2014 at 11:49 AM, EXTERNAL Taminidi Ravi (ETI,
> > Automotive-Service-Solutions) <ex...@us.bosch.com>
> > wrote:
> >>
> >> Hi  I am looking boosting to help if I can achieve the Rank equal to MS
> SQL Server.
> >>
> >> I have a query something like
> >>
> >> &fq=(SKU:123-87458) OR  Name:" 123-87458"
> >>
> >> I need to get the Exact Match as first in the results, In this case
> SKU. But also I can change to display Name in the List which is not exact
> match but match , the value can be find some where in the Name?
> >>
> >> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some
> customer Rank Name as 1 and SKU as 2 in the results.
> >>
> >> Is this Possible , I tried Boosting but that it seems it is for Text,
> correct me if I am wrong on understanding and any example will be really
> appreciated. I am getting confused after going thru different sites.
> >>
> >>
> >> Thanks
> >>
>



-- 
With Regards
Aman Tandon

Re: Relevance/Rank

Posted by Erick Erickson <er...@gmail.com>.
What Shawn said. q=*:* is a "constant score query", i.e. every match
has a score as 1.0.
fq clauses don't contribute to the score. The boosts you're specifying
have absolutely no effect.
Move the fq clause to your main query (q=) to see any effect.
Try adding &debug=all to your query and look at the explanation of how
the score is calculated, I suspect you'll find them all 1.0.

Best,
Erick

On Thu, Apr 10, 2014 at 12:53 PM, EXTERNAL Taminidi Ravi (ETI,
Automotive-Service-Solutions) <ex...@us.bosch.com>
wrote:
> Eric, Below is the query part
>
> select?q=*:*&fq={!join%20from=SKU%20to=SKU%20fromIndex=Collection2}(CatalogName:*Products)&fq=(SKU:204-161)%20OR%20(Name:%22204-161%22)&bq=Name:%22204-161%22^20000
> I am not getting the Name Match record in the first list , I am getting always SKU matching Record.
>
> Any help is really appreciated.
>
> Thanks
>
> Ravi
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: Thursday, April 10, 2014 3:35 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Relevance/Rank
>
> What kind of field is "Name"? Assuming it's string, you should be able to boost it. Boosts are not relevant to filters (fq) clauses at all, where were you trying to add the boost?
>
> You need to provide significantly more information to get a more helpful answer. You might review:
>
> http://wiki.apache.org/solr/UsingMailingLists
>
> bq:  I am getting confused after going thru different sites.
>
> You're in luck, the Solr Reference Guide
> (https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide)
> is becoming the collected source of information. Also, here's a sorely-needed set of up-to-date info:
> http://www.manning.com/grainger/, and Jack Krupansky is publishing an e-book here: http://www.lulu.com/spotlight/JackKrupansky (this is the last link I have, there may be more recent copies).
>
> Best,
> Erick
>
> On Thu, Apr 10, 2014 at 11:49 AM, EXTERNAL Taminidi Ravi (ETI,
> Automotive-Service-Solutions) <ex...@us.bosch.com>
> wrote:
>>
>> Hi  I am looking boosting to help if I can achieve the Rank equal to MS SQL Server.
>>
>> I have a query something like
>>
>> &fq=(SKU:123-87458) OR  Name:" 123-87458"
>>
>> I need to get the Exact Match as first in the results, In this case SKU. But also I can change to display Name in the List which is not exact match but match , the value can be find some where in the Name?
>>
>> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some customer Rank Name as 1 and SKU as 2 in the results.
>>
>> Is this Possible , I tried Boosting but that it seems it is for Text, correct me if I am wrong on understanding and any example will be really appreciated. I am getting confused after going thru different sites.
>>
>>
>> Thanks
>>

RE: Relevance/Rank

Posted by "EXTERNAL Taminidi Ravi (ETI, Automotive-Service-Solutions)" <ex...@us.bosch.com>.
Eric, Below is the query part

select?q=*:*&fq={!join%20from=SKU%20to=SKU%20fromIndex=Collection2}(CatalogName:*Products)&fq=(SKU:204-161)%20OR%20(Name:%22204-161%22)&bq=Name:%22204-161%22^20000
I am not getting the Name Match record in the first list , I am getting always SKU matching Record.

Any help is really appreciated.

Thanks

Ravi

-----Original Message-----
From: Erick Erickson [mailto:erickerickson@gmail.com] 
Sent: Thursday, April 10, 2014 3:35 PM
To: solr-user@lucene.apache.org
Subject: Re: Relevance/Rank

What kind of field is "Name"? Assuming it's string, you should be able to boost it. Boosts are not relevant to filters (fq) clauses at all, where were you trying to add the boost?

You need to provide significantly more information to get a more helpful answer. You might review:

http://wiki.apache.org/solr/UsingMailingLists

bq:  I am getting confused after going thru different sites.

You're in luck, the Solr Reference Guide
(https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide)
is becoming the collected source of information. Also, here's a sorely-needed set of up-to-date info:
http://www.manning.com/grainger/, and Jack Krupansky is publishing an e-book here: http://www.lulu.com/spotlight/JackKrupansky (this is the last link I have, there may be more recent copies).

Best,
Erick

On Thu, Apr 10, 2014 at 11:49 AM, EXTERNAL Taminidi Ravi (ETI,
Automotive-Service-Solutions) <ex...@us.bosch.com>
wrote:
>
> Hi  I am looking boosting to help if I can achieve the Rank equal to MS SQL Server.
>
> I have a query something like
>
> &fq=(SKU:123-87458) OR  Name:" 123-87458"
>
> I need to get the Exact Match as first in the results, In this case SKU. But also I can change to display Name in the List which is not exact match but match , the value can be find some where in the Name?
>
> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some customer Rank Name as 1 and SKU as 2 in the results.
>
> Is this Possible , I tried Boosting but that it seems it is for Text, correct me if I am wrong on understanding and any example will be really appreciated. I am getting confused after going thru different sites.
>
>
> Thanks
>

Re: Relevance/Rank

Posted by Erick Erickson <er...@gmail.com>.
What kind of field is "Name"? Assuming it's string, you should be able
to boost it. Boosts are not relevant to filters (fq) clauses at all,
where were you trying to add the boost?

You need to provide significantly more information to get a more
helpful answer. You might review:

http://wiki.apache.org/solr/UsingMailingLists

bq:  I am getting confused after going thru different sites.

You're in luck, the Solr Reference Guide
(https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide)
is becoming the collected source of information. Also, here's a
sorely-needed set of up-to-date info:
http://www.manning.com/grainger/, and Jack Krupansky is publishing an
e-book here: http://www.lulu.com/spotlight/JackKrupansky (this is the
last link I have, there may be more recent copies).

Best,
Erick

On Thu, Apr 10, 2014 at 11:49 AM, EXTERNAL Taminidi Ravi (ETI,
Automotive-Service-Solutions) <ex...@us.bosch.com>
wrote:
>
> Hi  I am looking boosting to help if I can achieve the Rank equal to MS SQL Server.
>
> I have a query something like
>
> &fq=(SKU:123-87458) OR  Name:" 123-87458"
>
> I need to get the Exact Match as first in the results, In this case SKU. But also I can change to display Name in the List which is not exact match but match , the value can be find some where in the Name?
>
> In Simple I can Rank SKU as 1 and Name as 2 for some customer and some customer Rank Name as 1 and SKU as 2 in the results.
>
> Is this Possible , I tried Boosting but that it seems it is for Text, correct me if I am wrong on understanding and any example will be really appreciated. I am getting confused after going thru different sites.
>
>
> Thanks
>