Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: jackrabbit-core, query
    • Labels:
      None

      Description

      Lucene 2.1 contains a number of useful enhancements, which could be benefical to jackrabbit:

      • less locking on index updates -> less IO calls
      • introduces FieldSelector -> allows jackrabbit to only load required fields
      1. patch.txt
        2 kB
        David Johnson
      2. lucene_2.2.0_patch.diff
        2 kB
        fabrizio giustina

        Issue Links

          Activity

          Hide
          David Johnson added a comment -

          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.

          Show
          David Johnson added a comment - 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.
          Hide
          Jukka Zitting added a comment -

          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.

          Show
          Jukka Zitting added a comment - 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.
          Hide
          David Johnson added a comment -

          Patch file for upgrade to Lucene 2.1.0

          Show
          David Johnson added a comment - Patch file for upgrade to Lucene 2.1.0
          Hide
          Marcel Reutegger added a comment -

          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.

          Show
          Marcel Reutegger added a comment - 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.
          Hide
          Marcel Reutegger added a comment -

          Committed above mentioned patch in revision: 523265

          Show
          Marcel Reutegger added a comment - Committed above mentioned patch in revision: 523265
          Hide
          Jukka Zitting added a comment -

          Tagging the actual POM dependency upgrade for Jackrabbit 1.4.

          Show
          Jukka Zitting added a comment - Tagging the actual POM dependency upgrade for Jackrabbit 1.4.
          Hide
          Jukka Zitting added a comment -

          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.

          Show
          Jukka Zitting added a comment - 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.
          Hide
          fabrizio giustina added a comment -

          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.

          Show
          fabrizio giustina added a comment - 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.
          Hide
          Jukka Zitting added a comment -

          Excellent! Patch applied in revision 558194.

          Show
          Jukka Zitting added a comment - Excellent! Patch applied in revision 558194.

            People

            • Assignee:
              Jukka Zitting
              Reporter:
              Marcel Reutegger
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development