Hello, Michael.
I suppose you can bind f2 to custom lazy implementation of DoubleValuesSource,
which defer advanceExact() by storing doc num and returning true always,
and actually advancing on doubleValue() only.

On Tue, Oct 25, 2022 at 8:13 PM Michael Sokolov <msoko...@gmail.com> wrote:

> ExpressionFunctionValueSource lazily evaluates in doubleValues: an
> expression like
>
>    condition ? f1 : f2
>
> will only evaluate one of f1 or f2.
>
> At the same time, the advanceExact() call is greedy -- when you
> advance that expression it will also advance both f1 and f2. But
> here's the thing: it always returns true, regardless of whether f1 and
> f2 advance. Which makes sense from the point of view of the lazy
> evaluation -- if condition is true we don't care whether f2 advances
> or not.
>
> My question is whether we could defer these child advanceExact calls
> until ExpressionFunctionValues.doubleValue()?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>
>

-- 
Sincerely yours
Mikhail Khludnev

Reply via email to