DismaxRequestHandler reports sort by score as invalid

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

DismaxRequestHandler reports sort by score as invalid

gerard sychay
Hello all,

This is a minor issue and does not affect Solr operation,
but I could not find it in the issue tracking.

To reproduce:

- I set up a Solr server with the example docs indexed by
following the Solr tutorial.

- I clicked on the following example search under the
"Sorting" section:

http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc

- I added a "qt" parameter to try out the DisMax Request
Handler:

http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc&qt=dismax

- In the Solr output, I get:

WARNING: Invalid sort "score desc" was specified, ignoring
Jun 21, 2007 10:33:37 AM org.apache.solr.core.SolrCore execute
INFO: /select/ sort=score+desc&indent=on&qt=dismax&q=video 0 131

The WARNING line is the issue. It does not seem that it
should be there. But as I said, it does not appear to affect
operation as the results are sorted by score descending
anyway (because that is the default?).
Reply | Threaded
Open this post in threaded view
|

Re: DismaxRequestHandler reports sort by score as invalid

jjlarrea
Because "score desc" is the default Lucene & Solr behavior when no explicit sort is specified, QueryParsing.parseSort() returns a null sort so that the non-sort versions of the query execution routines get called.  However the caller SolrPluginUtils.parseSort issues that warning whenever it gets a null sort.  Perhaps that interaction should be altered, or perhaps it should be left in as a sort of "are you sure you want to tell me what I already know?", er, warning.  But as it stands you can simply ignore it, or else leave the sort off entirely when it is "score desc"; if the behavior were different in those two cases it would certainly be a bug, but as you noted that's not the case.

- J.J.

At 10:50 AM -0400 6/21/07, gerard sychay wrote:

>Hello all,
>
>This is a minor issue and does not affect Solr operation, but I could not find it in the issue tracking.
>
>To reproduce:
>
>- I set up a Solr server with the example docs indexed by following the Solr tutorial.
>
>- I clicked on the following example search under the "Sorting" section:
>
>http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc
>
>- I added a "qt" parameter to try out the DisMax Request Handler:
>
>http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc&qt=dismax
>
>- In the Solr output, I get:
>
>WARNING: Invalid sort "score desc" was specified, ignoring Jun 21, 2007 10:33:37 AM org.apache.solr.core.SolrCore execute
>INFO: /select/ sort=score+desc&indent=on&qt=dismax&q=video 0 131
>
>The WARNING line is the issue. It does not seem that it should be there. But as I said, it does not appear to affect operation as the results are sorted by score descending anyway (because that is the default?).

Reply | Threaded
Open this post in threaded view
|

Re: DismaxRequestHandler reports sort by score as invalid

Yonik Seeley-2
In reply to this post by gerard sychay
A little background:
I originally conceived of query operation chains (based on some of my
previous hacking in mechanical investing stock screens: select all
stocks; take top 10% lowest PE; then take the top 20 highest growth
rate; then sort descending by 13 week relative strength).

So, I thought that the next thing after a query *might* be a sort, so
getSort() shouldn't throw an exception if it wasn't.  I think this
idea is now outdated (we know when we have a sort spec) and an
exception should just be thrown on a syntax error.

-Yonik

On 6/21/07, J.J. Larrea <[hidden email]> wrote:

> Because "score desc" is the default Lucene & Solr behavior when no explicit sort is specified, QueryParsing.parseSort() returns a null sort so that the non-sort versions of the query execution routines get called.  However the caller SolrPluginUtils.parseSort issues that warning whenever it gets a null sort.  Perhaps that interaction should be altered, or perhaps it should be left in as a sort of "are you sure you want to tell me what I already know?", er, warning.  But as it stands you can simply ignore it, or else leave the sort off entirely when it is "score desc"; if the behavior were different in those two cases it would certainly be a bug, but as you noted that's not the case.
>
> - J.J.
>
> At 10:50 AM -0400 6/21/07, gerard sychay wrote:
> >Hello all,
> >
> >This is a minor issue and does not affect Solr operation, but I could not find it in the issue tracking.
> >
> >To reproduce:
> >
> >- I set up a Solr server with the example docs indexed by following the Solr tutorial.
> >
> >- I clicked on the following example search under the "Sorting" section:
> >
> >http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc
> >
> >- I added a "qt" parameter to try out the DisMax Request Handler:
> >
> >http://localhost:8983/solr/select/?indent=on&q=video&sort=score+desc&qt=dismax
> >
> >- In the Solr output, I get:
> >
> >WARNING: Invalid sort "score desc" was specified, ignoring Jun 21, 2007 10:33:37 AM org.apache.solr.core.SolrCore execute
> >INFO: /select/ sort=score+desc&indent=on&qt=dismax&q=video 0 131
> >
> >The WARNING line is the issue. It does not seem that it should be there. But as I said, it does not appear to affect operation as the results are sorted by score descending anyway (because that is the default?).
>
>
Reply | Threaded
Open this post in threaded view
|

Re: DismaxRequestHandler reports sort by score as invalid

Chris Hostetter-3
In reply to this post by gerard sychay

as mentioned, the warning is missleading in the case where you sort by
socre, i filed a bug as a reminder to fix it (and so people searching for
it will understand what's going on)

patches welcome! :)

http://issues.apache.org/jira/browse/SOLR-270

: WARNING: Invalid sort "score desc" was specified, ignoring


-Hoss