If index is pre-3.0 IndexWriter does not fail on open
-----------------------------------------------------

                 Key: LUCENE-2552
                 URL: https://issues.apache.org/jira/browse/LUCENE-2552
             Project: Lucene - Java
          Issue Type: Sub-task
          Components: Index
            Reporter: Uwe Schindler
            Priority: Minor
             Fix For: 3.1, 4.0


IndexReader.open() fails for all old pre-3.0 indexes in Lucene trunk. This is 
tested by TestBackwardCompatibility. On the other hand, IndexWriter's ctor does 
not fail on open an existing index, that contains an old segment, because it 
does not check preexisting segments. It only throws IndexFormatTooOldException, 
if you merge segments or open a getReader(). When ConcurrentMergeScheduler  is 
used, this may happen in an foreign thread which makes it even worse.

Mike and me propose:
- In 3.x introduce a new segments file format when committing, that contains 
the oldest and newest version of the index segments (not sure which version 
number to take here), this file format has new version, so its easy to detect 
(DefaultSegmentsFileWriter/Reader)
- In trunk when opening IndexWriter check the following: If segments file is in 
new format, check minimum version from this file, if pre-3.0 throw IFTOE; if 
segments file is in old format (can be 3.0 or 3.x index not yet updated), try 
to open FieldsReader, as 2.9 indexes only can be detected using this - older 
indexes should fail before and never come to that place. If this succeeds, 
write a new segments file in new format (maybe after commit or whatever)

-- 
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]

Reply via email to