siren-join icon indicating copy to clipboard operation
siren-join copied to clipboard

Return set

Open calicartel opened this issue 7 years ago • 3 comments

Hello, I wanted to enquire about expected behavior when I issue a query that finds related objects in multiple indices.

What I was hoping that if Siren found the relation, it would return both objects related... otherwise, I still have to issue multiple queries to get all the data.

Currently, I just get the one object... not sure if that's intended, or I'm just doing something wrong.

calicartel avatar Apr 24 '17 15:04 calicartel

If I understand correctly, that is intended. If you have two indices A and B and make a query on A that joins with B, then you'd get back the documents from A that are connected to B.

scampi avatar Apr 24 '17 15:04 scampi

Ok, so it looks like I will indeed have to issue two queries.

Once the first query gives me back any of the objects, I'll have the "object_id" field, and, I have a query that gives me all the objects based on object_id.

Is that how it would work?

calicartel avatar Apr 24 '17 16:04 calicartel

That sounds correct. The first query gives you the subset of B that is connected to A, with which you query for the documents in A. You will end up with two result sets that are the documents connected between the two indices.

scampi avatar Apr 26 '17 17:04 scampi