Lucene - Core
  1. Lucene - Core
  2. LUCENE-2142

FieldCache.getStringIndex should not throw exception if term count exceeds doc count

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.4, 3.0.3, 3.1, 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Spinoff of LUCENE-2133/LUCENE-831.

      Currently FieldCache cannot handle more than one value per field.
      We may someday want to fix that... but until that day:

      FieldCache.getStringIndex currently does a simplistic check to try to
      catch when you've accidentally allowed more than one term per field,
      by testing if the number of unique terms exceeds the number of
      documents.

      The problem is, this is not a perfect check, in that it allows false
      negatives (you could have more than one term per field for some docs
      and the check won't catch you).

      Further, the exception thrown is the unchecked RuntimeException.

      So this means... you could happily think all is good, until some day,
      well into production, once you've updated enough docs, suddenly the
      check will catch you and throw an unhandled exception, stopping all
      searches [that need to sort by this string field] in their tracks.
      It's not gracefully degrading.

      I think we should simply remove the test, ie, if you have more terms
      than docs then the terms simply overwrite one another.

      1. LUCENE-2142-fix-3x.patch
        2 kB
        Uwe Schindler
      2. LUCENE-2142-fix-trunk.patch
        1 kB
        Uwe Schindler
      3. LUCENE-2142-trunk.patch
        3 kB
        Michael McCandless

        Issue Links

          Activity

          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12564161 ] jira [ 12583913 ]
          Mark Thomas made changes -
          Workflow jira [ 12484361 ] Default workflow, editable Closed status [ 12564161 ]
          Hoss Man made changes -
          Link This issue breaks SOLR-2339 [ SOLR-2339 ]
          Hoss Man made changes -
          Link This issue is related to SOLR-2249 [ SOLR-2249 ]
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Michael McCandless made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Michael McCandless made changes -
          Attachment LUCENE-2142-trunk.patch [ 12447940 ]
          Uwe Schindler made changes -
          Fix Version/s 2.9.4 [ 12315148 ]
          Fix Version/s 3.0.3 [ 12315147 ]
          Fix Version/s 3.0.2 [ 12314798 ]
          Fix Version/s 2.9.3 [ 12314799 ]
          Uwe Schindler made changes -
          Attachment LUCENE-2142-fix.patch [ 12447525 ]
          Uwe Schindler made changes -
          Attachment LUCENE-2142-fix-3x.patch [ 12447527 ]
          Attachment LUCENE-2142-fix-trunk.patch [ 12447528 ]
          Uwe Schindler made changes -
          Attachment LUCENE-2142-fix.patch [ 12447525 ]
          Michael McCandless made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Michael McCandless made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 3.0.2 [ 12314798 ]
          Fix Version/s 3.1 [ 12314822 ]
          Resolution Fixed [ 1 ]
          Michael McCandless made changes -
          Fix Version/s 2.9.3 [ 12314799 ]
          Michael McCandless made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Michael McCandless made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Michael McCandless created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development