Solr
  1. Solr
  2. SOLR-5231

When a boolean field is missing from a doc it is sometimes treated as "true" by the "if" function (based on other docs in segment?)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2, 4.3, 4.3.1, 4.4
    • Fix Version/s: 4.5, Trunk
    • Component/s: None
    • Labels:
      None

      Description

      This issue is hard to explain with out a long example.

      crux of the problem is that the behavior of the if function, wrapped arround a boolean field (ie: "if(fieldName,x,y)" ) is not consistent for documents that do not have any value for that functio – the behavior seems to depend on whether or not other documents in the same segment have a value for that field.

      for brevity, details will follow in a comment - but i've been able to reproduce on trunk, 4.3, and 4.3 (didn't look back farther then that)

      the work around is to explicitly use the exists() function in the if condition (ie: "if(exists(fieldName),x,y)" )

      (Thanks to Elodie Sannier for reporting the initial symptoms of this on the mailing list)

        Issue Links

          Activity

          Adrien Grand made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hoss Man made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hoss Man made changes -
          Assignee Hoss Man [ hossman ]
          Fix Version/s 4.5 [ 12324743 ]
          Fix Version/s 5.0 [ 12321664 ]
          Affects Version/s 4.3.1 [ 12324395 ]
          Affects Version/s 4.3 [ 12324128 ]
          Affects Version/s 4.2 [ 12323893 ]
          Yonik Seeley made changes -
          Comment [ bq. Caused by complete lack of unit tests for BoolField.

          Go ahead and try and pass the buck like you usually do - we all know you're incapable of making a mistake. Except for that this bug didn't exist before LUCENE-4547, and did after. Oops.
          ]
          Yonik Seeley made changes -
          Link This issue is broken by LUCENE-4547 [ LUCENE-4547 ]
          Hoss Man made changes -
          Field Original Value New Value
          Attachment SOLR-5231.patch [ 12602489 ]
          Hoss Man created issue -

            People

            • Assignee:
              Hoss Man
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development