I use a Codec to flush data. All methods delegate to actual Lucene42Codec, except for intercepting one single-field. This field is indexed as an IntField [Numeric-Trie...], with precisionStep=4.
The purpose of the Codec is as follows 1. Note the first BytesRef for this field 2. During finish() call [TermsConsumer.java], note the last BytesRef for this field 3. Converts both the first/last BytesRef to respective integers 4. Store these 2 ints in segment-info diagnostics The problem with this approach is that, first/last BytesRef is totally different from the actual "int" values I try to index. I guess, this is because Numeric-Trie explodes all the integers into it's own format of BytesRefs. Hence my Codec stores the wrong values in segment-diagnostics Is there a way I can record actual min/max int-values correctly in my codec and still support NumericRange search? -- Ravi