(no subject)


(Abhishek Jajoria) #1

How can we apply sql joins in elasticsearch queries
like

SELECT * FROM Persons
RIGHT JOIN Orders
ON Persons.P_Id=Orders.P_Id

I have two index with types persons and Orders
related with each other using P_ID field.


(Shaun Farrell) #2

You need to flatten this. Either put order Ids in the person or the person ids in the orders

Sent from my iPhone

On Mar 29, 2012, at 7:57 AM, jajoria abhishek jajoria.abhishek@gmail.com wrote:

How can we apply sql joins in elasticsearch queries
like

SELECT * FROM Persons
RIGHT JOIN Orders
ON Persons.P_Id=Orders.P_Id

I have two index with types persons and Orders
related with each other using P_ID field.


(Abhishek Jajoria) #3

But in this case you have to alter the index mapping and you have to Index
according to queries.
On Fri, Mar 30, 2012 at 4:51 AM, Shaun Farrell farrelley@gmail.com wrote:

You need to flatten this. Either put order Ids in the person or the person
ids in the orders

Sent from my iPhone

On Mar 29, 2012, at 7:57 AM, jajoria abhishek jajoria.abhishek@gmail.com
wrote:

How can we apply sql joins in elasticsearch queries
like

SELECT * FROM Persons
RIGHT JOIN Orders
ON Persons.P_Id=Orders.P_Id

I have two index with types persons and Orders
related with each other using P_ID field.


(Thomas Peuss) #4

Hi Abhishek!

Am Freitag, 30. März 2012 06:55:47 UTC+2 schrieb jajoria abhishek:

But in this case you have to alter the index mapping and you have to
Index according to queries.

Exactly. Like in any other NoSQL-DB as well. :wink:

CU
Thomas


(Abhishek Jajoria) #5

Thanks for your responses

On Fri, Mar 30, 2012 at 12:16 PM, Thomas Peuss thomas.peuss@nterra.comwrote:

Hi Abhishek!

Am Freitag, 30. März 2012 06:55:47 UTC+2 schrieb jajoria abhishek:

But in this case you have to alter the index mapping and you have to
Index according to queries.

Exactly. Like in any other NoSQL-DB as well. :wink:

CU
Thomas


(system) #6