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 Clecio Varjao <cl...@gmail.com> on 2011/06/02 23:13:24 UTC

Sorting

Hi,

When using the following URL:
http://localhost:8080/solr/StatReg/select?version=2.2&sort=path+asc&fl=path&start=0&q=paths%3A%222%2Froot%2FStatReg%2F--+C+--%22&hl=off&rows=500

I get the result in the following order:

[...]
/-- C --/Community Care Facility Act [RSBC 1996] c. 60/00_96060REP_01.xml
/-- C --/Community Care and Assisted Living Act [SBC 2002] c. 75/00_02075_01.xml
[...]

However, the order is not right "and Assisted" should come before
"Facitity Act".

I'm using the following schema configuration:

<fieldtype name="string"  class="solr.StrField" sortMissingLast="true"
omitNorms="true"/>

<field name="path"   type="string"   indexed="true"  stored="true"
multiValued="false" />

Thanks,

Clécio

Re: Sorting

Posted by Juan Grande <ju...@gmail.com>.
Hi Clécio,

Your problem may be caused by case sensitiveness of string fields. Try using
the "lowercase" field type that comes in the example.

Regards,

*Juan*



On Thu, Jun 2, 2011 at 6:13 PM, Clecio Varjao <cl...@gmail.com>wrote:

> Hi,
>
> When using the following URL:
>
> http://localhost:8080/solr/StatReg/select?version=2.2&sort=path+asc&fl=path&start=0&q=paths%3A%222%2Froot%2FStatReg%2F--+C+--%22&hl=off&rows=500
>
> I get the result in the following order:
>
> [...]
> /-- C --/Community Care Facility Act [RSBC 1996] c. 60/00_96060REP_01.xml
> /-- C --/Community Care and Assisted Living Act [SBC 2002] c.
> 75/00_02075_01.xml
> [...]
>
> However, the order is not right "and Assisted" should come before
> "Facitity Act".
>
> I'm using the following schema configuration:
>
> <fieldtype name="string"  class="solr.StrField" sortMissingLast="true"
> omitNorms="true"/>
>
> <field name="path"   type="string"   indexed="true"  stored="true"
> multiValued="false" />
>
> Thanks,
>
> Clécio
>

Re: Sorting

Posted by Clecio Varjao <cl...@gmail.com>.
Because when browsing through legislation, people want to browse in
the same order as it is actually printed in the hard copy volumes.
It did work by using a copyfield to a lowercase field.

On Fri, Jun 3, 2011 at 2:29 AM, pravesh <su...@yahoo.com> wrote:
> BTW, why r u sorting on this field?
> You could also index & store this field twice. First, in its original value,
> and then second, by encoding to some unique code/hash and index it and sort
> on that.
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Sorting-tp3017285p3019055.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Sorting

Posted by pravesh <su...@yahoo.com>.
BTW, why r u sorting on this field?
You could also index & store this field twice. First, in its original value,
and then second, by encoding to some unique code/hash and index it and sort
on that.

--
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-tp3017285p3019055.html
Sent from the Solr - User mailing list archive at Nabble.com.