[ https://issues.apache.org/jira/browse/LUCENE-1452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647556#action_12647556 ]
Michael McCandless commented on LUCENE-1452: -------------------------------------------- I found the issue. It was caused by LUCENE-1219 (first released in 2.4.0), which added a reuse API to Fieldable for binary fields. When loading a field for merging we were failing to set the binaryLength. A similar case affected lazy field merging (I extended the test case to show it). This is a silent data loss bug. It only affects non-compressed binary fields. Whenever segments are merged such that the segment's fields are non-congruent (ie, the same field name was assigned different field numbers across the segments being merged), then binary fields in those segments are all set to 0 length. I will commit shortly. > Binary field content lost during optimize > ----------------------------------------- > > Key: LUCENE-1452 > URL: https://issues.apache.org/jira/browse/LUCENE-1452 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Affects Versions: 2.4, 2.9 > Environment: Ubuntu 8.04, x86_64 > Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode) > Reporter: Andrzej Bialecki > Assignee: Michael McCandless > Attachments: binaryField-junit.patch > > > Scenario: > * create an index with arbitrary content, and close it > * open IndexWriter again, and add a document with binary field (stored but > not compressed) > * close IndexWriter _without_ optimizing, so that the new document is in a > separate segment. > * open IndexReader. You can read the last document and its binary field just > fine. > * open IndexWriter, optimize the index, close IndexWriter > * open IndexReader. Now the field is still present (not null) and is marked > as binary, but the data is not there - Field.getBinaryLength() returns 0. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]