In lucene, all the data is stored as strings, so if you have a field defined as integer or sint, in lucene are strings, and if you try to sort numbers represented as strings what happens is this:

example numbers: 1,2,3,4,5,6,7,8,9,10,11,12,13.
ordered as strings:    1,10,11,12,13,2,3,4,5,6,7,8,9

That's why there is a field type called sint, that means sortable int. Is the same as int with the difference that it will order the numbers properly.

example numbers: 1,2,3,4,5,6,7,8,9,10,11,12,13.
order being int:    1,10,11,12,13,2,3,4,5,6,7,8,9
order being sint:  1,2,3,4,5,6,7,8,9,10,11,12,13.

Pako

[EMAIL PROTECTED] wrote:
U
------Original Message------
From: sanraj25
To: solr-user@lucene.apache.org
ReplyTo: solr-user@lucene.apache.org
Sent: Oct 9, 2008 10:13 PM
Subject: Re: sint in schema.xml


Hi,
      I create own field name using integer field type and sint field
type(solr.SortableIntField) in schema.xml.
i can't differentiate between these two field type. When this sint exactly
use? If we use sint how it is sortable?



sanraj25 wrote:
Hi,
      I create own field name using integer field type and sint field
type(solr.SortableIntField) in schema.xml.
i can't differentiate between these two field type. When this sint exactly
use? If we use sint how it is sortable? I test by {sort =field name} in
query window .but it's not work properly.please tell me with clear example
thanks in advance

-sanraj




Reply via email to