This SQL query is a join and in general elasticsearch does not support
joins.

If the id field is your PK, you might be able to do it by indexing B as a
child of A (using parent/child) and then searching for all documents in A
that have a child in B.



On Wed, Apr 22, 2015 at 4:11 PM, Tiago Filipe <odecarac...@gmail.com> wrote:

> I'm new to ElasticSearch and I'm struggling with this question. Basically
> what I want to do is sort of like this (SQL Example):
>
> SELECT A.id
> FROM TableA A, TableB B
> WHERE A.id = B.id;
>
> I want a Query that returns all of the info from TableA, but only if the
> id from TableA is equal to an id from TableB. I've read a lot of Query
> Filter fields and I think I might use the Term Field
> <http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-term-query.html>
>  but
> I'm not sure how.
>
> Thanks in advance!
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/1ad75f69-8623-4dcf-a58c-2a9bfa0eb4a7%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/1ad75f69-8623-4dcf-a58c-2a9bfa0eb4a7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adrien

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAh33ecJ%3DbOmakfopgaDMCn7Lw%2BENjQvx0bV%3Dk5%3DQnUR3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to