Is it possible to write it into single ES query ? (SQL: self join)

I have problem, I want to retrieve all the document wherever same user
participate in event1 and event2.

{ "user": "user1", "event": "event1" }
{ "user": "user2", "event": "event1" }
{ "user": "user3", "event": "event2" }
{ "user": "user1", "event": "event2" }
{ "user": "user4", "event": "event1" }
{ "user": "user1", "event": "event3" }

Is it possible to write it into single query ?

SQL query, something similar like this:
select * from userTable u1, u2 where u1.user = u2.user AND ( ( u1.event =
event1 and u2.event = event2) OR ( u1.event = event2 and u2.event = event1))

Result should be:
{ "user": "user1", "event": "event1" }
{ "user": "user1", "event": "event2" }

Thanks,
Vijay

--
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/d20f58a4-dfb4-4226-8b4b-9dae3d5bc00d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.