Example usage for org.apache.lucene.document LongPoint encodeDimension

List of usage examples for org.apache.lucene.document LongPoint encodeDimension

Introduction

In this page you can find the example usage for org.apache.lucene.document LongPoint encodeDimension.

Prototype

public static void encodeDimension(long value, byte dest[], int offset) 

Source Link

Document

Encode single long dimension

Usage

From source file:org.apache.solr.schema.DatePointField.java

License:Apache License

@Override
public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
    Date date = (Date) toNativeType(val.toString());
    result.grow(Long.BYTES);//from ww  w. ja v  a  2 s .c  o m
    result.setLength(Long.BYTES);
    LongPoint.encodeDimension(date.getTime(), result.bytes(), 0);
}

From source file:org.apache.solr.schema.LongPointField.java

License:Apache License

@Override
public void readableToIndexed(CharSequence val, BytesRefBuilder result) {
    result.grow(Long.BYTES);//from  w w  w  .ja  v a 2 s  .  c  om
    result.setLength(Long.BYTES);
    LongPoint.encodeDimension(Long.parseLong(val.toString()), result.bytes(), 0);
}