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 Andrey Klochkov <ak...@griddynamics.com> on 2009/04/29 15:46:12 UTC

function query scoring

Hi!

Base on docs in the wiki I thought that the following query should return
constant score "5" for all "socks" in the index:

http://localhost:8080/solr/select?q=name:socks _val_:5&fl=name,score

But in fact it finds all the products in the index and it seems that
"socks" products have higher score than others. What I need and what
function query seems have to do is to find ONLY socks and assign constant
score to all of them. Isn't it correct? I took  function query with constant
value just as an example.

-- 
Andrew Klochkov

Re: function query scoring

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Apr 29, 2009 at 9:15 PM, Umar Shah <um...@wisdomtap.com> wrote:

> can anyone explan the behavior of function query if there are other
> terms in the query
>
> it seems the value of the function query and actual match score are
> interfering in some manner. what should be expected?
>
>
Yes, if you include a term in the q field, it is scored according to the
tf-idf based lucene scoring. The example in the wiki is incorrect I guess,
it should have used a filter query.

You can see how the query is parsed using debugQuery=on. My guess is that
q=field:value _val_:5 is being evaluated as an or between the term query and
the function query. That is why documents matching the term query are ranked
higher due to the tf-idf score.

-- 
Regards,
Shalin Shekhar Mangar.

Re: function query scoring

Posted by Umar Shah <um...@wisdomtap.com>.
On Wed, Apr 29, 2009 at 8:34 PM, Andrey Klochkov
<ak...@griddynamics.com> wrote:
> On Wed, Apr 29, 2009 at 6:44 PM, Umar Shah <um...@wisdomtap.com> wrote:
>
>> On Wed, Apr 29, 2009 at 7:16 PM, Andrey Klochkov
>> <ak...@griddynamics.com> wrote:
>> > Hi!
>> >
>> > Base on docs in the wiki I thought that the following query should return
>> > constant score "5" for all "socks" in the index:
>> >
>> > http://localhost:8080/solr/select?q=name:socks _val_:5&fl=name,score
>>
>> the intended query should looklike
>>
>> http://localhost:8080/solr/select?q=_val_:5&fl=name,score&fq=name:socks
>>
>> return all docs with name containing socks with constant score of 5
>>
>
> Well, thanks for the tip.
> But then the examples in wiki are incorrect, look at the bottom of this page
> (General Example):
>
> http://wiki.apache.org/solr/FunctionQuery#head-af37201ea1d04df780e5044ef560b8558998ee24
>

yes so it seems,

can anyone explan the behavior of function query if there are other
terms in the query

it seems the value of the function query and actual match score are
interfering in some manner. what should be expected?


> --
> Andrew Klochkov
>



-- 
Umar Shah
Research Engineer
Wisdomtap Solutions India (P) Ltd.
---------------------------------------------------------------------------
Get WisdomRank for your products @  http://services.wisdomtap.com

View opinions and recommendations about:

Point and Shoot Cameras,  DSLRs Lenses at http://www.wisdomtap.com/camera/

Mobile Phones at http://www.wisdomtap.com/mobile

Access above services from your mobile devices from http://m.wisdomtap.com
--------------------------------------------------------------------------

Re: function query scoring

Posted by Andrey Klochkov <ak...@griddynamics.com>.
On Wed, Apr 29, 2009 at 6:44 PM, Umar Shah <um...@wisdomtap.com> wrote:

> On Wed, Apr 29, 2009 at 7:16 PM, Andrey Klochkov
> <ak...@griddynamics.com> wrote:
> > Hi!
> >
> > Base on docs in the wiki I thought that the following query should return
> > constant score "5" for all "socks" in the index:
> >
> > http://localhost:8080/solr/select?q=name:socks _val_:5&fl=name,score
>
> the intended query should looklike
>
> http://localhost:8080/solr/select?q=_val_:5&fl=name,score&fq=name:socks
>
> return all docs with name containing socks with constant score of 5
>

Well, thanks for the tip.
But then the examples in wiki are incorrect, look at the bottom of this page
(General Example):

http://wiki.apache.org/solr/FunctionQuery#head-af37201ea1d04df780e5044ef560b8558998ee24

-- 
Andrew Klochkov

Re: function query scoring

Posted by Umar Shah <um...@wisdomtap.com>.
On Wed, Apr 29, 2009 at 7:16 PM, Andrey Klochkov
<ak...@griddynamics.com> wrote:
> Hi!
>
> Base on docs in the wiki I thought that the following query should return
> constant score "5" for all "socks" in the index:
>
> http://localhost:8080/solr/select?q=name:socks _val_:5&fl=name,score

the intended query should looklike

http://localhost:8080/solr/select?q=_val_:5&fl=name,score&fq=name:socks

return all docs with name containing socks with constant score of 5

>
> But in fact it finds all the products in the index and it seems that
> "socks" products have higher score than others. What I need and what
> function query seems have to do is to find ONLY socks and assign constant
> score to all of them. Isn't it correct? I took  function query with constant
> value just as an example.
>
> --
> Andrew Klochkov
>



-- 
Umar Shah
Research Engineer
Wisdomtap Solutions India (P) Ltd.
---------------------------------------------------------------------------
Get WisdomRank for your products @  http://services.wisdomtap.com

View opinions and recommendations about:

Point and Shoot Cameras,  DSLRs Lenses at http://www.wisdomtap.com/camera/

Mobile Phones at http://www.wisdomtap.com/mobile

Access above services from your mobile devices from http://m.wisdomtap.com
--------------------------------------------------------------------------