Example usage for org.apache.lucene.util SmallFloat intToByte4

List of usage examples for org.apache.lucene.util SmallFloat intToByte4

Introduction

In this page you can find the example usage for org.apache.lucene.util SmallFloat intToByte4.

Prototype

public static byte intToByte4(int i) 

Source Link

Document

Encode an integer to a byte.

Usage

From source file:org.elasticsearch.index.similarity.ScriptedSimilarity.java

License:Apache License

@Override
public long computeNorm(FieldInvertState state) {
    final int numTerms = discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
    return SmallFloat.intToByte4(numTerms);
}