-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record if block API has been used in SegmentInfo #12685
Conversation
If the add/updateDocuments(List<>) API is used, lucene guarantees that all documents are indexed in the same segment with consecutive document IDs. This enables features like nested documents etc. This change records the usage of this API in SegmentsInfo and preserves this property across merges. Relates to apache#12665
if (docCount < 0) { | ||
throw new CorruptIndexException("invalid docCount: " + docCount, input); | ||
} | ||
final boolean isCompoundFile = input.readByte() == SegmentInfo.YES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of writing a byte each time here and change index format we could also write a bitset to mark features like this. it might be easier down the road. not sure how often it happens.
lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
Outdated
Show resolved
Hide resolved
@jpountz I pushed new commits, wanna take a new look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
If the add/updateDocuments(List<>) API is used, lucene guarantees that all documents are indexed in the same segment with consecutive document IDs. This enables features like nested documents etc. This change records the usage of this API in SegmentsInfo and preserves this property across merges. Relates to #12665
FYI we've seen failures on TestIndexWriter recently, which are reproducible (e.g. https://ci-builds.apache.org/job/Lucene/job/Lucene-NightlyTests-9.x/720/). I ran git bisect and it pointed to this change. I'm unsure why though. |
I pushed fixes... thanks @jpountz |
This is needed following apache/lucene#12685 and apache/lucene#12582
…foFormat These are needed after apache/lucene#12685
If the add/updateDocuments(List<>) API is used, lucene guarantees that all documents are indexed in the same segment with consecutive document IDs. This enables features like nested documents etc. This change records the usage of this API in SegmentInfo and preserves this property across merges.
Relates to #12665