Java Code Examples for org.apache.lucene.document.FloatPoint#decodeDimension()

The following examples show how to use org.apache.lucene.document.FloatPoint#decodeDimension() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PointMerger.java    From lucene-solr with Apache License 2.0 6 votes vote down vote up
@Override
public void visit(int docID, byte[] packedValue) throws IOException {
  // TODO: handle filter or deleted documents?
  float v = FloatPoint.decodeDimension(packedValue, 0);
  if (v < last) return;

  if (v == last && pos >= 0) {
    count[pos]++;
  } else {
    if (pos+1 < values.length) {
      last = v;
      ++pos;
      values[pos] = v;
      count[pos] = 1;
    } else {
      // a new value we don't have room for
      throw breakException;
    }
  }
}
 
Example 2
Source File: PointMerger.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public PointValues.Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {
  float v = FloatPoint.decodeDimension(maxPackedValue, 0);
  if (v >= last) {
    return PointValues.Relation.CELL_CROSSES_QUERY;
  } else {
    return PointValues.Relation.CELL_OUTSIDE_QUERY;
  }
}
 
Example 3
Source File: FloatPointField.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public Object toObject(SchemaField sf, BytesRef term) {
  return FloatPoint.decodeDimension(term.bytes, term.offset);
}
 
Example 4
Source File: NumberFieldMapper.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public Number parsePoint(byte[] value) {
    return FloatPoint.decodeDimension(value, 0);
}