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 Jonathan Haddad <jo...@letsgetnuts.com> on 2009/02/24 02:40:20 UTC

sint vs integer

What are the differences between using an sint and an integer, aside
from the range queries on sint?  If I've indexed a field as an
integer, and I try to sort on it, will there be performance problem?

About 1.5 million documents in index.
-- 
Jonathan Haddad
http://www.rustyrazorblade.com

Re: sint vs integer

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Mon, Feb 23, 2009 at 8:40 PM, Jonathan Haddad <jo...@letsgetnuts.com> wrote:
> What are the differences between using an sint and an integer, aside
> from the range queries on sint?  If I've indexed a field as an
> integer, and I try to sort on it, will there be performance problem?

Nope.  If you don't need range queries, use "integer".
Sorts work correctly on both because the sort code does not rely on
the index order of the terms.


-Yonik
Lucene/Solr? http://www.lucidimagination.com

Re: sint vs integer

Posted by Amit Nithian <an...@gmail.com>.
I believe the difference is that an sint is mangled in such a way that it
will sort properly (i.e. during a range query) where as a regular integer is
not. Since everything is stored as a string in lucene, sorting by numbers
happens lexicographically which may not be the same as an ordinal sort. The
sint datatype will ensure this ordinal sort by some mangling of the
characters (hence if you look at an sint from the lucene index it looks like
garbage).
Hope that helps
Amit

On Mon, Feb 23, 2009 at 5:40 PM, Jonathan Haddad <jo...@letsgetnuts.com>wrote:

> What are the differences between using an sint and an integer, aside
> from the range queries on sint?  If I've indexed a field as an
> integer, and I try to sort on it, will there be performance problem?
>
> About 1.5 million documents in index.
> --
> Jonathan Haddad
> http://www.rustyrazorblade.com
>