lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaime <j.par...@estructure.es>
Subject Problem sorting long integers
Date Tue, 13 Dec 2016 17:30:09 GMT
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


Mime
View raw message