sirensolutions / siren-join

[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]
http://siren.io
GNU Affero General Public License v3.0
183 stars 60 forks source link

Return set #130

Open calicartel opened 7 years ago

calicartel commented 7 years ago

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.

scampi commented 7 years ago

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.

calicartel commented 7 years ago

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?

scampi commented 7 years ago

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.