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 Asif Rahman <as...@newscred.com> on 2009/03/27 03:24:19 UTC

Incorrect sort with with function query in query parameters

Hi all,

I'm having an issue with the order of my results when attempting to sort by
a function in my query.  Looking at the debug output of the query, the score
returned with in the result section for any given document does not match
the score in the debug output.  It turns out that if I optimize the index,
then the results are sorted correctly.  The scores in the debug output are
the correct scores.  This behavior only occurs using a recent nightly build
of Solr.  It works correctly in Solr 1.3.

An example query is:

http://localhost:8080/solr/core-01/select?qt=standard&fl=*,score&rows=10&q=*:*%20_val_:"recip(rord(article_published_at),1,1000,1000)"^10000&debugQuery=on

I've attached the result to this email.

Can anybody shed any light on this problem? 

Thanks,

Asif
http://www.nabble.com/file/p22735009/result.xml result.xml 
-- 
View this message in context: http://www.nabble.com/Incorrect-sort-with-with-function-query-in-query-parameters-tp22735009p22735009.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Incorrect sort with with function query in query parameters

Posted by Asif Rahman <as...@newscred.com>.
I have been intending to although I have been dragging my feet on it.  I've
never opened a bug before so I'm not sure of the protocol.  If you don't
mind, it would be great if you could send me a pm and point me in the right
direction.

Thanks,

Asif


On Mon, May 18, 2009 at 7:30 PM, Ensdorf Ken <En...@zoominfo.com> wrote:

> >
> > A Unit test would be ideal, but even if you can just provide a list of
> > steps (ie: using this solrconfig+schema, index these docs, then update
> > this one doc, then execute this search) it can help people track things
> > down.
> >
> > Please open a bug and attach as much detail as you can there.
> >
> >
> > -Hoss
>
> Was a bug ever opened on this?  I am seeing similar behavior (though in my
> case it's the debug scores that look wrong).
>
> -Ken
>
>

RE: Incorrect sort with with function query in query parameters

Posted by Ensdorf Ken <En...@zoominfo.com>.
>
> A Unit test would be ideal, but even if you can just provide a list of
> steps (ie: using this solrconfig+schema, index these docs, then update
> this one doc, then execute this search) it can help people track things
> down.
>
> Please open a bug and attach as much detail as you can there.
>
>
> -Hoss

Was a bug ever opened on this?  I am seeing similar behavior (though in my case it's the debug scores that look wrong).

-Ken


Re: Incorrect sort with with function query in query parameters

Posted by Chris Hostetter <ho...@fucit.org>.
: Any documents marked deleted in this index are just the result of updates to
: those documents.  There are no purely deleted documents.  Furthermore, the
: field that I am ordering by in my function query remains untouched over the
: updates.

it doesn't matter wether it was an update or a true delete -- in the 
underlying code it's still a deleted document, which can affect some of 
the logic

: I've read in other posts that the logic used by the debug component to
: calculate the score is different from what the query component uses.  The
: score shown in the debug output is correct.  It seems like the two
: components are getting two different values for the rord function.

it's possible there is a bug in the scoring code, and that the debug code 
is actaully doing the correct calcuation -- but it's very unlikely.  9 
times out of 10 when there is a mismatch it's because hte debugging code 
is doing something wrong.

In either case: if there's a discrepency, then it means there is a bug 
somewhere. if you can provide a small reproducable example that would be 
the best way to try and track down where the bug is.

A Unit test would be ideal, but even if you can just provide a list of 
steps (ie: using this solrconfig+schema, index these docs, then update 
this one doc, then execute this search) it can help people track things 
down.

Please open a bug and attach as much detail as you can there.


-Hoss


Re: Incorrect sort with with function query in query parameters

Posted by Asif Rahman <as...@newscred.com>.
Hi Otis,

Any documents marked deleted in this index are just the result of updates to
those documents.  There are no purely deleted documents.  Furthermore, the
field that I am ordering by in my function query remains untouched over the
updates.

I've read in other posts that the logic used by the debug component to
calculate the score is different from what the query component uses.  The
score shown in the debug output is correct.  It seems like the two
components are getting two different values for the rord function.

I'm particularly concerned by the fact that this only happens in the nightly
build.  Any ideas on how to correct this?  Unfortunately, it's not feasible
for me to only perform searches on optimized indices because we are doing
constant updates.

Thanks,

Asif


Otis Gospodnetic wrote:
> 
> 
> Asif,
> 
> Could it have something to do with the deleted documents in your
> unoptimized index?  There documents are only marked as deleted.  When you
> run optimize you really remove them completely.  It could be that they are
> getting counted by something and that messes up the scoring/order.
> 
> 

-- 
View this message in context: http://www.nabble.com/Incorrect-sort-with-with-function-query-in-query-parameters-tp22735009p22741058.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Incorrect sort with with function query in query parameters

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Asif,

Could it have something to do with the deleted documents in your unoptimized index?  There documents are only marked as deleted.  When you run optimize you really remove them completely.  It could be that they are getting counted by something and that messes up the scoring/order.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Asif Rahman <as...@newscred.com>
> To: solr-user@lucene.apache.org
> Sent: Thursday, March 26, 2009 10:24:19 PM
> Subject: Incorrect sort with with function query in query parameters
> 
> 
> Hi all,
> 
> I'm having an issue with the order of my results when attempting to sort by
> a function in my query.  Looking at the debug output of the query, the score
> returned with in the result section for any given document does not match
> the score in the debug output.  It turns out that if I optimize the index,
> then the results are sorted correctly.  The scores in the debug output are
> the correct scores.  This behavior only occurs using a recent nightly build
> of Solr.  It works correctly in Solr 1.3.
> 
> An example query is:
> 
> http://localhost:8080/solr/core-01/select?qt=standard&fl=*,score&rows=10&q=*:*%20_val_:"recip(rord(article_published_at),1,1000,1000)"^10000&debugQuery=on
> 
> I've attached the result to this email.
> 
> Can anybody shed any light on this problem? 
> 
> Thanks,
> 
> Asif
> http://www.nabble.com/file/p22735009/result.xml result.xml 
> -- 
> View this message in context: 
> http://www.nabble.com/Incorrect-sort-with-with-function-query-in-query-parameters-tp22735009p22735009.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Incorrect sort with with function query in query parameters

Posted by Yonik Seeley <yo...@lucidimagination.com>.
This was fixed April 24th
https://issues.apache.org/jira/browse/SOLR-1124
  explained further in
https://issues.apache.org/jira/browse/SOLR-1111

-Yonik
http://www.lucidimagination.com

On Thu, Mar 26, 2009 at 10:24 PM, Asif Rahman <as...@newscred.com> wrote:
>
> Hi all,
>
> I'm having an issue with the order of my results when attempting to sort by
> a function in my query.  Looking at the debug output of the query, the score
> returned with in the result section for any given document does not match
> the score in the debug output.  It turns out that if I optimize the index,
> then the results are sorted correctly.  The scores in the debug output are
> the correct scores.  This behavior only occurs using a recent nightly build
> of Solr.  It works correctly in Solr 1.3.
>
> An example query is:
>
> http://localhost:8080/solr/core-01/select?qt=standard&fl=*,score&rows=10&q=*:*%20_val_:"recip(rord(article_published_at),1,1000,1000)"^10000&debugQuery=on
>
> I've attached the result to this email.
>
> Can anybody shed any light on this problem?
>
> Thanks,
>
> Asif
> http://www.nabble.com/file/p22735009/result.xml result.xml
> --
> View this message in context: http://www.nabble.com/Incorrect-sort-with-with-function-query-in-query-parameters-tp22735009p22735009.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>