diff --git a/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsConsumer.java b/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsConsumer.java index badd318bbf78d..6805383f74a42 100644 --- a/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsConsumer.java +++ b/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsConsumer.java @@ -138,9 +138,9 @@ public void write(Fields fields, NormsProducer norms) throws IOException { writer.write(pe, postingsOut); termsOut.writeVInt(term.length); termsOut.writeBytes(term.bytes, term.offset, term.length); - termsOut.writeInt(writer.docFreq); + termsOut.writeVInt(writer.docFreq); if (hasFreqs) { - termsOut.writeLong(writer.totalTermFreq); + termsOut.writeVLong(writer.totalTermFreq); } if (hasPositions) { termsOut.writeLong(proxOffset); diff --git a/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsProducer.java b/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsProducer.java index b6e7c20666f62..9cbff04263f37 100644 --- a/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsProducer.java +++ b/server/src/main/java/org/elasticsearch/index/codec/postings/ES814InlineFieldsProducer.java @@ -485,10 +485,10 @@ private void scanNextTermInCurrentFrame() throws IOException { assert loadedFrameIndex == state.blockIndex : loadedFrameIndex + " != " + state.blockIndex; term.setLength(termsReader.readVInt()); termsReader.readBytes(term.bytes(), 0, term.length()); - state.docFreq = termsReader.readInt(); + state.docFreq = termsReader.readVInt(); if (meta.options.compareTo(IndexOptions.DOCS_AND_FREQS) >= 0) { - state.totalTermFreq = termsReader.readLong(); + state.totalTermFreq = termsReader.readVLong(); } else { state.totalTermFreq = state.docFreq; }