Nested Query

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Nested Query

javashankar
This post has NOT been accepted by the mailing list yet.
Hi All

I'm new to ElasticSearch. I'm using ES-JDBC to pull my data into ES. I have my documents in below format

"deptno": 30, "dname": "SALES", "empno": [7499,7654,7698,7844],"ename": ["AL SMITH","MARTIN","BLAKE","TURNER"]
"deptno": 20, "dname": "RESEARCH", "empno": [7369,7566,7788,7876,7900,7902],"ename": ["Smith","JONES","SCOTT","ADAMS","JAMES","FORD"]

I want to fetch EMP & DEPT details of a matching employee only. for e.g. empno = 7654

"deptno": 30, "dname": "SALES", "empno": [7654],"ename": ["MARTIN"]

what should be my query ? I'm getting all the siblings of emp under his dept.

Thanks In Advance
Jay