lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Lorenzetto <cristian.lorenze...@gmail.com>
Subject sorting biginteger
Date Sun, 21 Aug 2016 09:50:53 GMT
I took a look for bigInteger point but i didnt see no reference for
sorting,
and SortedNumericDocValuesField accept long not biginteger.


I thought to sort so :

BigInteger bi = (BigInteger) o;
byte[] b = bi.toByteArray();
NumericUtils.bigIntToSortableBytes(bi, BigIntegerPoint.BYTES, b, 0);
doc.add(new SortedSetDocValuesField(key, new BytesRef(b)));

it is correct and it is the best practice ?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message