Hi guys! I am a newbie and I am trying to upgrade from Lucene 6.2.1 to 8.4.1 The previous code was leveraging this https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.2.1/lucene/core/src/java/org/apache/lucene/index/NumericDocValues.java#L34
now https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.4.1/lucene/core/src/java/org/apache/lucene/index/NumericDocValues.java#L32-L35 Previously there was no need to deal with the iterator and I found in the code a comment regarding ** Returns the numeric value for the current document ID. * It is illegal to call this method after {@link #advanceExact(int)} * returned {@code false}. * @return numeric value* If the below snippet is not correct how should I proceed? public static float getFloatValueFromNumericDocValuesAndDocId(NumericDocValues numericDocValues, int docId) throws IOException { if (numericDocValues.advanceExact(docId)) { return Float.intBitsToFloat((int)numericDocValues.longValue()); } else { throw new RuntimeException("It has not been possible to advanceExact for " + docId) ; } } public static int getIntValueFromNumericDocValuesAndDocId(NumericDocValues numericDocValues, int docId) throws IOException { if (numericDocValues.advanceExact(docId)) { return (int) numericDocValues.longValue(); } else { throw new RuntimeException("It has not been possible to advanceExact for " + docId) ; } } public static long getLongValueFromNumericDocValuesAndDocId(NumericDocValues numericDocValues, int docId) throws IOException { if (numericDocValues.advanceExact(docId)) { return numericDocValues.longValue(); } else { throw new RuntimeException("It has not been possible to advanceExact for " + docId) ; } } public static BytesRef getBytesRefValueFromSortedDocValuesAndDocId(SortedDocValues numericDocValues, int docId) throws IOException { if (numericDocValues.advanceExact(docId)) { return numericDocValues.binaryValue(); } else { throw new RuntimeException("It has not been possible to advanceExact for " + docId) ; } } Thanks to everyone! Sergio