I needed to change 2 files - the pom.xml of jackrabbit-core and org.apache.jackrabbit.core.query.lucene.PersistentIndex.java

While all tests pass, I am not sure if my change to PersistentIndex is right - specifically I commented out the code pertaining to COMMIT_LOCK as this seems to have been removed or moved to another class in Lucene 2.1

Is this worth a patch? As Marcel stated, this appears to be a good upgrade, so I would like to get this in sooner rather than later.

David Johnson
added a comment - 26/Mar/07 22:07 I have upgraded my local version to Lucene 2.1
I needed to change 2 files - the pom.xml of jackrabbit-core and org.apache.jackrabbit.core.query.lucene.PersistentIndex.java
While all tests pass, I am not sure if my change to PersistentIndex is right - specifically I commented out the code pertaining to COMMIT_LOCK as this seems to have been removed or moved to another class in Lucene 2.1
Is this worth a patch? As Marcel stated, this appears to be a good upgrade, so I would like to get this in sooner rather than later.

Please do share a patch with your changes. It's always easier to judge a change if the actual code is available. BTW, would the modified class still work with Lucene 2.0? I also assume that Lucene 2.1 is compatible with indexes created with 2.0.

I agree that we should try to keep up with Lucene upgrades, but on the other hand I would not want to force too frequent dependency changes on users. If the change works with Lucene 2.0, then existing users wouldn't need to upgrade their dependencies. If not, then the upgrade procedure needs to be documented in the release notes.

If there is no immediate demand for the upgrade, I would rather wait until Jackrabbit 1.3 is branched before doing this.

Jukka Zitting
added a comment - 26/Mar/07 22:59 Please do share a patch with your changes. It's always easier to judge a change if the actual code is available. BTW, would the modified class still work with Lucene 2.0? I also assume that Lucene 2.1 is compatible with indexes created with 2.0.
I agree that we should try to keep up with Lucene upgrades, but on the other hand I would not want to force too frequent dependency changes on users. If the change works with Lucene 2.0, then existing users wouldn't need to upgrade their dependencies. If not, then the upgrade procedure needs to be documented in the release notes.
If there is no immediate demand for the upgrade, I would rather wait until Jackrabbit 1.3 is branched before doing this.

I think it is actually possible to upgrade lucene without this change because the compiler puts the commit.lock literal into the PersistentIndex class file and therefore removes the dependency to the IndexWriter.COMMIT_LOCK_NAME field.

Marcel Reutegger
added a comment - 27/Mar/07 10:25 Lucene 2.1 can read index files created with previous releases, but will write new files in the 2.1 version. Once you upgrade to 2.1 you cannot go back anymore, unless you re-index the repository.
Because lucene 2.1 is not yet available in a maven 2 repository and the change is only minor I would rather keep the 2.0 compile dependency in the pom. I suggest the following change:
Index: PersistentIndex.java
===================================================================
— PersistentIndex.java (revision 520911)
+++ PersistentIndex.java (working copy)
@@ -42,7 +42,7 @@
private static final String WRITE_LOCK = IndexWriter.WRITE_LOCK_NAME;
/** Name of the commit lock file */
private static final String COMMIT_LOCK = IndexWriter.COMMIT_LOCK_NAME;
+ private static final String COMMIT_LOCK = "commit.lock";
/** The name of this persistent index */
private final String name;
This allows the sources to compile with either 2.0 or 2.1.
I think it is actually possible to upgrade lucene without this change because the compiler puts the commit.lock literal into the PersistentIndex class file and therefore removes the dependency to the IndexWriter.COMMIT_LOCK_NAME field.

Jukka Zitting
added a comment - 20/Jun/07 10:40 Lucene 2.2 was just released with even more good stuff. The artifacts and proper POMs are also now up on the central Maven repository.
Updated issue summary to upgrade to Lucene 2.2 instead of 2.1.

The attached patch upgrades the lucene dependency to 2.2.0 (pom update + just a few additional methods added in FilteredTermPositions).
Tests run fine after the patch, you should be able to apply this without problems.

fabrizio giustina
added a comment - 17/Jul/07 23:54 The attached patch upgrades the lucene dependency to 2.2.0 (pom update + just a few additional methods added in FilteredTermPositions).
Tests run fine after the patch, you should be able to apply this without problems.