@@ -125,25 +125,6 @@ private long[] writeField(FieldInfo field, DocValuesProducer valuesProducer, lon
125125 numValues += count ;
126126 }
127127
128- if (numDocsWithValue == 0 ) { // meta[-2, 0]: No documents with values
129- meta .writeLong (-2 ); // docsWithFieldOffset
130- meta .writeLong (0L ); // docsWithFieldLength
131- meta .writeShort ((short ) -1 ); // jumpTableEntryCount
132- meta .writeByte ((byte ) -1 ); // denseRankPower
133- } else if (numDocsWithValue == maxDoc ) { // meta[-1, 0]: All documents have values
134- meta .writeLong (-1 ); // docsWithFieldOffset
135- meta .writeLong (0L ); // docsWithFieldLength
136- meta .writeShort ((short ) -1 ); // jumpTableEntryCount
137- meta .writeByte ((byte ) -1 ); // denseRankPower
138- } else { // meta[data.offset, data.length]: IndexedDISI structure for documents with values
139- long offset = data .getFilePointer ();
140- meta .writeLong (offset ); // docsWithFieldOffset
141- values = valuesProducer .getSortedNumeric (field );
142- final short jumpTableEntryCount = IndexedDISI .writeBitSet (values , data , IndexedDISI .DEFAULT_DENSE_RANK_POWER );
143- meta .writeLong (data .getFilePointer () - offset ); // docsWithFieldLength
144- meta .writeShort (jumpTableEntryCount );
145- meta .writeByte (IndexedDISI .DEFAULT_DENSE_RANK_POWER );
146- }
147128 meta .writeLong (numValues );
148129 meta .writeInt (numDocsWithValue );
149130
@@ -207,6 +188,26 @@ private long[] writeField(FieldInfo field, DocValuesProducer valuesProducer, lon
207188 meta .writeLong (valuesDataLength );
208189 }
209190
191+ if (numDocsWithValue == 0 ) { // meta[-2, 0]: No documents with values
192+ meta .writeLong (-2 ); // docsWithFieldOffset
193+ meta .writeLong (0L ); // docsWithFieldLength
194+ meta .writeShort ((short ) -1 ); // jumpTableEntryCount
195+ meta .writeByte ((byte ) -1 ); // denseRankPower
196+ } else if (numDocsWithValue == maxDoc ) { // meta[-1, 0]: All documents have values
197+ meta .writeLong (-1 ); // docsWithFieldOffset
198+ meta .writeLong (0L ); // docsWithFieldLength
199+ meta .writeShort ((short ) -1 ); // jumpTableEntryCount
200+ meta .writeByte ((byte ) -1 ); // denseRankPower
201+ } else { // meta[data.offset, data.length]: IndexedDISI structure for documents with values
202+ long offset = data .getFilePointer ();
203+ meta .writeLong (offset ); // docsWithFieldOffset
204+ values = valuesProducer .getSortedNumeric (field );
205+ final short jumpTableEntryCount = IndexedDISI .writeBitSet (values , data , IndexedDISI .DEFAULT_DENSE_RANK_POWER );
206+ meta .writeLong (data .getFilePointer () - offset ); // docsWithFieldLength
207+ meta .writeShort (jumpTableEntryCount );
208+ meta .writeByte (IndexedDISI .DEFAULT_DENSE_RANK_POWER );
209+ }
210+
210211 return new long [] { numDocsWithValue , numValues };
211212 }
212213
0 commit comments