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

Specified default value not returned for query() when doc doesn't match

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.6
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      The 2 arg version of the "query()" was designed so that the second argument would specify the value used for any document that does not match the query pecified by the first argument – but the "exists" property of the resulting ValueSource only takes into consideration wether or not the document matches the query – and ignores the use of the second argument.


      The work around is to ignore the 2 arg form of the query() function, and instead wrap he query function in def().

      for example: def(query($something), $defaultval) instead of query($something, $defaultval)

        Attachments

        1. LUCENE-8908.patch
          5 kB
          Munendra S N
        2. LUCENE-8908.patch
          5 kB
          Munendra S N
        3. SOLR-7845.patch
          5 kB
          Munendra S N
        4. SOLR-7845.patch
          3 kB
          Munendra S N

        Issue Links

          Activity

            People

            • Assignee:
              munendrasn Munendra S N
              Reporter:
              billnbell Bill Bell

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment