How to use JOIN operation in elasticsearch?


(Nagarajan S) #1

I have sql like

select s.name
from Student s join Mark m
on s.sid = m.sid
where s.sid = 101

how can i replicate the same functionality in elastic search ?

Thanks and Regards,
Nagarajan Sivaraman

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fb8cf0aa-70c1-4078-b500-0b1ac776d332%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Nagarajan S) #2

let the where condition is m.english = 91

On Monday, 17 March 2014 19:02:16 UTC+5:30, Nagarajan S wrote:

I have sql like

select s.name
from Student s join Mark m
on s.sid = m.sid
where s.sid = 101

how can i replicate the same functionality in elastic search ?

Thanks and Regards,
Nagarajan Sivaraman

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2ab36777-8965-46d4-b7de-ab4dc3ae3ea7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #3

Unlike SQL, Elasticsearch does not support joins from 1 index to another.
There is a notion of relationships in ES, but it's not exactly like SQL.
Your best bet generally is to denormalize your tables (student, mark) and
then use queries/filters for the where clause. If you still want to venture
into the ES relationships capabilities, here is a good tutorial:

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/15cff183-64c8-4bbc-b600-cd132d03c7ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4