[
https://issues.apache.org/jira/browse/SOLR-13524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18122106#comment-18122106
]
Nick Shanin commented on SOLR-13524:
------------------------------------
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
I opened a PR for this: https://github.com/apache/solr/pull/5013
OrEvaluator no longer inherits the pairwise reduction loop from
RecursiveBooleanEvaluator, which returns false as soon as one adjacent pair
fails and is only correct for AND style checkers. or() with more than two
arguments, for example (true, false, true), could therefore return false.
OrEvaluator now reduces its values directly, and OrEvaluatorTest covers the
multi-argument case.
> Or Stream Evaluator produces incorrect results with more than 2 arguments
> -------------------------------------------------------------------------
>
> Key: SOLR-13524
> URL: https://issues.apache.org/jira/browse/SOLR-13524
> Project: Solr
> Issue Type: Bug
> Components: streaming expressions
> Affects Versions: 7.7.1
> Reporter: Oleksandr Chornyi
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> h3. Background
> [Documentation for the
> OR|https://lucene.apache.org/solr/guide/7_7/stream-evaluator-reference.html#or]
> evaluator says that it "will return the logical OR of at least 2 boolean
> parameters." The evaluator indeed accepts more than two parameters:
> {code:java}
> or(true, true, true){code}
> returns {{true}}. However, it stops evaluating other parameters when the
> first two parameters evaluate to false.
> h3. Steps to Reproduce
> Evaluate the following expression:
> {code:java}
> or(false, false, true)
> {code}
> *Expected Result*: {{"return-value": true}}
> *Actual Result*: {{"return-value": false}}
> Â
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]