Lucene - Core
  1. Lucene - Core
  2. LUCENE-3529

creating empty field + empty term leads to invalid index

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Spinoff from LUCENE-3526.

      • if you create new Field("", ""), you get IllegalArgumentException from Field's ctor: "name and value cannot both be empty"
      • But there are tons of other ways to index an empty term for the empty field (for example initially make it "garbage" then .setValue(""), or via tokenstream).
      • If you do this, and you have assertions enabled, you will trip an assert (the assert is fixed in trunk, in LUCENE-3526)
      • But If you don't have assertions enabled, you will create a corrupt index: test: terms, freq, prox...ERROR [term : docFreq=1 != num docs seen 0 + num docs deleted 0]
      1. LUCENE-3529.patch
        5 kB
        Robert Muir
      2. LUCENE-3529_test.patch
        3 kB
        Robert Muir

        Activity

        Robert Muir created issue -
        Hide
        Robert Muir added a comment -

        attached is a test (committed to trunk).

        I also fixed the assert and removed the bogus check in Field's ctor.

        But the checkIndex fails (as it does before, if you index this term with assertions disabled). So next step is to figure out a fix...

        Show
        Robert Muir added a comment - attached is a test (committed to trunk). I also fixed the assert and removed the bogus check in Field's ctor. But the checkIndex fails (as it does before, if you index this term with assertions disabled). So next step is to figure out a fix...
        Robert Muir made changes -
        Field Original Value New Value
        Attachment LUCENE-3529_test.patch [ 12500511 ]
        Hide
        Robert Muir added a comment -

        attached is a patch... its basically just a backport of LUCENE-3526 to fix the problem.

        Show
        Robert Muir added a comment - attached is a patch... its basically just a backport of LUCENE-3526 to fix the problem.
        Robert Muir made changes -
        Attachment LUCENE-3529.patch [ 12500549 ]
        Hide
        Robert Muir added a comment -

        Thanks Mike, your fix from 3183 was correct all along... we should have just gone with it originally...

        Show
        Robert Muir added a comment - Thanks Mike, your fix from 3183 was correct all along... we should have just gone with it originally...
        Robert Muir made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.5 [ 12317877 ]
        Resolution Fixed [ 1 ]
        Hide
        Uwe Schindler added a comment -

        Bulk close after release of 3.5

        Show
        Uwe Schindler added a comment - Bulk close after release of 3.5
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development