Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4633

DirectoryTaxonomyWriter.replaceTaxonomy should refresh the reader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.1, 6.0
    • modules/facet
    • None
    • New, Patch Available

    Description

      While migrating code to Lucene 4.0 I tripped it. If you call replaceTaxonomy() with e.g. a taxonomy index that contains category "a", and then you try to add category "a" to the new taxonomy, it receives a new ordinal!

      The reason is that replaceTaxo doesn't refresh the internal IndexReader, but does clear the cache (as it should). This causes the next addCategory to not find category "a" in the cache, and not in the reader instance at hand.

      Simple fix, I'll attach a patch with it and a test exposing the bug.

      Attachments

        1. LUCENE-4633.patch
          4 kB
          Shai Erera

        Activity

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: