question regarding sorting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

question regarding sorting

James O'Rourke
I am having strange behaviour experimenting with the example solr  
server. Via the tutorial - except I set up my own schema. Anyway,  
here's the issue - if I provide the explicit "sort" param in my  
request, the sort does not seem to execute, however if I have the  
encoded sort via using "; field desc" for example, sorting does work.  
Is this expected behaviour? Is there something I'm missing.

Eg;

This does not sort:

<a href="http://localhost:8983/solr/select/?indent=on&q=24&sort=lastmodified%">http://localhost:8983/solr/select/?indent=on&q=24&sort=lastmodified% 
20desc&fl=uniquekey,lastmodified

This does:

<a href="http://localhost:8983/solr/select/?indent=on&q=24;%20lastmodified%">http://localhost:8983/solr/select/?indent=on&q=24;%20lastmodified% 
20asc&fl=uniquekey,lastmodified

Anyone know why?

James

Reply | Threaded
Open this post in threaded view
|

Re: question regarding sorting

Nick Jenkin-2
Hi James
I think this feature is in 1.2, which is not released yet (in CVS/nightly)

From http://wiki.apache.org/solr/StandardRequestHandler
"Note, in solr1.1 the query and sort parameter were combined as a
single parameter separated with a ';' (q="name:solr; date desc").
Since solr1.2, it is recommend to use the "sort" parameter described
in CommonQueryParameters."
-Nick


On 5/24/07, James O'Rourke <[hidden email]> wrote:

> I am having strange behaviour experimenting with the example solr
> server. Via the tutorial - except I set up my own schema. Anyway,
> here's the issue - if I provide the explicit "sort" param in my
> request, the sort does not seem to execute, however if I have the
> encoded sort via using "; field desc" for example, sorting does work.
> Is this expected behaviour? Is there something I'm missing.
>
> Eg;
>
> This does not sort:
>
> <a href="http://localhost:8983/solr/select/?indent=on&q=24&sort=lastmodified%">http://localhost:8983/solr/select/?indent=on&q=24&sort=lastmodified%
> 20desc&fl=uniquekey,lastmodified
>
> This does:
>
> <a href="http://localhost:8983/solr/select/?indent=on&q=24;%20lastmodified%">http://localhost:8983/solr/select/?indent=on&q=24;%20lastmodified%
> 20asc&fl=uniquekey,lastmodified
>
> Anyone know why?
>
> James
>
>