This expression works as expected:

intersect(
cartesianProduct(tuple(fieldA=array(a,b,c,c)), fieldA, productSort="fieldA
asc"),
cartesianProduct(tuple(fieldA=array(a,c)), fieldA, productSort="fieldA
asc"),
on="fieldA"
)

And when you transpose the "on" fields like this:

intersect(
 cartesianProduct(tuple(fieldA=array(a,b,c,c)), fieldA, productSort="fieldA
asc"),
 cartesianProduct(tuple(fieldB=array(a,c)), fieldB, productSort="fieldB
asc"),
 on="fieldB=fieldA"
 )

It also works.

So, yes there is a bug where the fields are being transposed with intersect
function's "on" fields. The same issue was happening with joins and may
have been resolved. I'll do little more research into this.







Joel Bernstein
http://joelsolr.blogspot.com/

On Thu, Jun 7, 2018 at 9:29 AM, Christian Spitzlay <
christian.spitz...@biologis.com> wrote:

>
>
> > Am 07.06.2018 um 11:34 schrieb Christian Spitzlay <
> christian.spitz...@biologis.com>:
> >
> > intersect(
> > cartesianProduct(tuple(fieldA=array(a,b,c,c)), fieldA,
> productSort="fieldA asc"),
> > cartesianProduct(tuple(fieldB=array(a,c)), fieldB, productSort="fieldB
> asc"),
> > on="fieldA=fieldB"
> > )
> >
> > I simplified it a bit, too. I still get one document with fieldA == a.
> > I would have expected three documents in the output, one with fieldA ==
> a and two with fieldB == c.
>
> That should have read ā€žā€¦ and two with fieldA == cā€œ of course.
>
>
>
>

Reply via email to