lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Problem sorting long integers
Date Tue, 13 Dec 2016 17:53:22 GMT


How are you constructing your SortField at query time?

Are you sure you are using SortField.Type.LONG ?

Can you show us some minimally self contained reproducible code 
demonstrating your problem? (ie: create an index with 2 docs, then do 
a simple serach for both and sort them and show that the order is wrong)


: Date: Tue, 13 Dec 2016 18:30:09 +0100
: From: Jaime <j.pardos@estructure.es>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: Problem sorting long integers
: 
: Hello,
: 
: With Lucene 6.1.0, I'm trying to search sorting the results by a long column.
: This is my indexing code:
: 
:     doc.add(new LongPoint(name, Long.parseLong(value)));
:     doc.add(new StoredField(name, value));
:     doc.add(new NumericDocValuesField(SORT_FIELD_PREFIX + name,
: Long.parseLong(value)));
: 
: SORT_FIELD_PREFIX is a prefix I use for sorting fields.
: My problem is, the sorting is being made modulo 4G (2^32) (and interpreted as
: signed values).
: So, first values are 2G, 4G, 6G, 8G, etc. Then would come 2G +1, 4G +1, 6G +1
: and so on.
: (I.e. only the 4 least significant bytes are taken into account).
: 
: Is this a bug, or there is some problem with my code?
: 
: Best Regards.
: 
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
: For additional commands, e-mail: java-user-help@lucene.apache.org
: 
: 

-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message