List of usage examples for org.apache.lucene.util NumericUtils longToSortableBytes
public static void longToSortableBytes(long value, byte[] result, int offset)
From source file:com.b2international.index.lucene.LongIndexField.java
License:Apache License
@Override protected BytesRef toBytesRef(Long value) { byte[] packed = new byte[Long.BYTES]; NumericUtils.longToSortableBytes(value, packed, 0); return new BytesRef(packed); }
From source file:org.elasticsearch.index.mapper.BinaryRangeUtil.java
License:Apache License
static byte[] encodeDouble(double number) { byte[] encoded = new byte[8]; NumericUtils.longToSortableBytes(NumericUtils.doubleToSortableLong(number), encoded, 0); return encoded; }