[ https://issues.apache.org/jira/browse/LUCENE-8908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060641#comment-17060641 ]
Munendra S N commented on LUCENE-8908: -------------------------------------- [^LUCENE-8908.patch] Revisiting this again based on the discussions from SOLR-8103. As summarized in the above comment by [~hossman] this doesn't fix all cases as some cases need to be handled in Solr's ValueSourceParser like {{exists}} behavior with or w/o defaultValue. So, I'm current plan is to handle the cases that are possible in lucene and other cases like above could be handled at Solr's side in a separate issue. Let me know if there are any objections cc [~dsmiley] [~micpalmia] > Specified default value not returned for query() when doc doesn't match > ----------------------------------------------------------------------- > > Key: LUCENE-8908 > URL: https://issues.apache.org/jira/browse/LUCENE-8908 > Project: Lucene - Core > Issue Type: Bug > Reporter: Bill Bell > Priority: Major > Attachments: LUCENE-8908.patch, LUCENE-8908.patch, SOLR-7845.patch, > SOLR-7845.patch > > > 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)}} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org