Skip to content

Commit

Permalink
Add bw tests for block-tree with inlined metadata. (apache#13527)
Browse files Browse the repository at this point in the history
The backport of apache#13524 found a hole in the testing of `Lucene40BlockTreeTerms`
for versions before we moved metadata to its own file. This PR adds explicit bw
testing for this version. Adding the correct if/else statements made the code
extremely complicated so I opted for restoring the file as it was at the time
when we bumped the version.

This also fixes the bug that we introduced in apache#13524.
  • Loading branch information
jpountz authored Jun 28, 2024
1 parent f8ee339 commit 44ad4d9
Show file tree
Hide file tree
Showing 4 changed files with 1,103 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public final class FieldReader extends Terms {
final IndexInput clone = indexIn.clone();
clone.seek(indexStartFP);
fstMetadata = readMetadata(clone, ByteSequenceOutputs.getSingleton());
// FST bytes actually only start after the metadata.
indexStartFP = clone.getFilePointer();
} else {
fstMetadata = readMetadata(metaIn, ByteSequenceOutputs.getSingleton());
}
Expand Down
Loading

0 comments on commit 44ad4d9

Please sign in to comment.