Nested/join scripted queries

Hello, I have a situation to write search query in elasticsearch having data as follows


scenario:- user's want to search people related to p2,and using each related person find who they are related to

1.first find who are related to p2 answer= p1

2.Now find people related to p1 answer=p3. (the requirement as of now is to go only 1-level) so no need to find people related to p3.the final result should be p2,p1,p3.

Normal scenario's we will write a nested sql to get results.How do we achieve this using elastic query language in one-shot

In terms of exploring connections between people you might find the recent blog post on the Graph plugin and Panama papers of interest:

Thanks for the info ,does graph has query search capability instead of graphical interface?
or i want to explore is there any scripted query for my scenario
as ppl are suggesting to go to neo4j.

Yep, API details here:

sorry for late reply, i have dome some reading on this,as of now am doing application side joins(i mean multiple queries ) but will explore more on thi sin future