Lucene - Core
  1. Lucene - Core
  2. LUCENE-3461

Adding same IndexDocValuesField twice trips assert

    Details

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

      Description

      Doc values fields are single-valued by design, ie a given field name can only occur once in the document.

      But if you accidentally add it more than once, you get an assert error, which is spooky because if you run w/o asserts maybe something eviler happens.

      I think we should explicitly check for this and throw clear exc since user could easily do this by accident.

      1. LUCENE-3461.patch
        1 kB
        Michael McCandless
      2. LUCENE-3461.patch
        5 kB
        Michael McCandless

        Activity

        Hide
        Michael McCandless added a comment -

        Patch w/ failing test case.

        Not yet sure where we should check... I think the assert is too low (it should remain) but higher up we should catch this.

        Show
        Michael McCandless added a comment - Patch w/ failing test case. Not yet sure where we should check... I think the assert is too low (it should remain) but higher up we should catch this.
        Hide
        Michael McCandless added a comment -

        Patch, catching more than one IDV fields in the same doc, and throwing IllegalArgExc.

        Test passes now.

        Show
        Michael McCandless added a comment - Patch, catching more than one IDV fields in the same doc, and throwing IllegalArgExc. Test passes now.

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development