Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335997 - [Help][Search] Allow indexes created with Lucene 1.9.1 to be read
Summary: [Help][Search] Allow indexes created with Lucene 1.9.1 to be read
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-01 13:27 EST by Chris Goldthorpe CLA
Modified: 2011-02-08 12:41 EST (History)
2 users (show)

See Also:


Attachments
Patch with tests (10.50 KB, patch)
2011-02-01 13:35 EST, Chris Goldthorpe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Goldthorpe CLA 2011-02-01 13:27:09 EST
+++ This bug was initially created as a clone of Bug #335144 +++

In Eclipse 3.7 M3, Lucene has been updated from 1.9.1 to 2.9.1 (see bug 248986). Only prebuilt indexes which have been built with the same Lucene version are used. 

... 

1.9.x prebuilt indexes seems to be compatible with a Lucene 2.x runtime. So we
can add in SearchIndex#isLuceneCompatible(String) before the last return:

    // Lucene 2.x can read 1.9.x indexes
    if (   version.getMajor() == 2
        && currentVersion.getMajor() == 1
        && currentVersion.getMinor() == 9) return true;

As a result of this Eclipse 3.7 would be able to read indexes built with
Eclipse 3.6 (or 3.5, 3.4, 3.3). I tested this with a very large 1.9.1 prebuilt
index: the prebuilt indexes were used (very fast indexing) and the search
results were correct, too.
Comment 1 Chris Goldthorpe CLA 2011-02-01 13:35:29 EST
Created attachment 188068 [details]
Patch with tests

Code to relax the dependency and add tests to verify that 1.9.1 and 2.9.1 prebuilt indexes can both load. The patch does not include to Lucene indexes added to the data directory in org.eclipse.ua.tests.
Comment 2 Chris Goldthorpe CLA 2011-02-01 13:36:53 EST
Patch committed to HEAD, Fixed
Comment 3 Holger Voormann CLA 2011-02-08 06:09:24 EST
(In reply to comment #2)
> Patch committed to HEAD, Fixed

Verified in N20110205-2000-win32. Thanks! :-)