Skip to content

Commit

Permalink
Update IndexDiskUsageAnalyzer#getBlockTermState(...) to use InlineTer…
Browse files Browse the repository at this point in the history
…mState
  • Loading branch information
martijnvg committed Jan 24, 2024
1 parent 0508cf1 commit bb9347f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.elasticsearch.core.CheckedConsumer;
import org.elasticsearch.core.IOUtils;
import org.elasticsearch.index.codec.postings.ES812PostingsFormat;
import org.elasticsearch.index.codec.postings.ES814InlinePostingsFormat;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.store.LuceneFilesExtensions;

Expand Down Expand Up @@ -303,6 +304,9 @@ private static void readProximity(Terms terms, PostingsEnum postings) throws IOE
private static BlockTermState getBlockTermState(TermsEnum termsEnum, BytesRef term) throws IOException {
if (term != null && termsEnum.seekExact(term)) {
final TermState termState = termsEnum.termState();
if (termState instanceof final ES814InlinePostingsFormat.InlineTermState ts) {
return new BlockTermState(ts.docOffset, ts.proxOffset, 0 /* no payloads */);
}
if (termState instanceof final ES812PostingsFormat.IntBlockTermState blockTermState) {
return new BlockTermState(blockTermState.docStartFP, blockTermState.posStartFP, blockTermState.payStartFP);
}
Expand Down

0 comments on commit bb9347f

Please sign in to comment.