Elasticsearch Query with subquery

I'm relatively new to elasticsearch. I can able to make simple query in dev tools. I need a help on converting the following sql into es query

select c.conversationid from conversations c
where c.conversationid not in
 (select s.conversationid from conversations s 
where s.type='end' and s.conversationid=c.conversationid)

Index looks like below.

conversationid type
1 start
2 start
1 end
3 start

If I execute above query I will get the following results.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.