APISonar


org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType.DATE

> org > elasticsearch > index > fielddata > IndexNumericFieldData > NumericType > DATE
org APIs elasticsearch APIs index APIs fielddata APIs IndexNumericFieldData APIs NumericType APIs DATE APIs

Example 1
private static Function<byte[], Comparable> datePointConverter(DateFieldType dateFieldType, String numericTypeStr) {
        if (numericTypeStr != null) {
            NumericType numericType = resolveNumericType(numericTypeStr);
            if (dateFieldType.resolution() == MILLISECONDS && numericType == NumericType.DATE_NANOSECONDS) {
                return v -> DateUtils.toNanoSeconds(LongPoint.decodeDimension(v, 0));
            } else if (dateFieldType.resolution() == NANOSECONDS && numericType == NumericType.DATE) {
                return v -> DateUtils.toMilliSeconds(LongPoint.decodeDimension(v, 0));
            }
        }
        return v -> LongPoint.decodeDimension(v, 0);
    }