If it's just 128 bit, do exactly what BigIntegerPoint does. Mike McCandless
http://blog.mikemccandless.com On Sat, Aug 27, 2016 at 2:03 PM, Cristian Lorenzetto <[email protected]> wrote: > Good suggestion :) I will do it. In the while i used just for 128bit. > > 2016-08-27 19:51 GMT+02:00 Michael McCandless <[email protected]>: >> >> I think to sort properly you must also ensure all byte[] from those >> BigIntegers are the same length, and that you sign extend them? >> Mike McCandless >> >> http://blog.mikemccandless.com >> >> >> On Sun, Aug 21, 2016 at 5:50 AM, Cristian Lorenzetto >> <[email protected]> wrote: >> > 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 ? > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
