Importing data into ElasticSearch from RDBMS

We are currently using Apache Solr and want to migrate to ElasticSearch. We have one requirement where we want to index data from RDBMS to ElasticSearch. The data is not in flat structure but as follows:

TableName: Employee

EmployeeID, EmpName
1234, ABCD
4231, XYZ
5534, QWERT

TableName: Emp-Department

EmployeeID DepartmentID
1234 333
1234 4123
4231 333
4231 555
5534 333

TableName: Department

DepartmentID DepartmentName
333 Finance
4123 HR
555 Logistics

The data that I want to index should be as below:

{
"EmployeeID":1234,
"EmpName":"ABCD",
"Department":["Finance","HR"]
},
{
"EmployeeID":4231,
"EmpName":"XYZ",
"Department":["Finance","Logistics"]
},
{
"EmployeeID":5534,
"EmpName":"QWERT",
"Department":["Finance"]
}

In Apache Solr I am able to achive this by having nested entities in the DataImportHandler. I am not able to figure how this can be achieved in ElasticSearch.

Kindly help.

You can try my JDBC importer https://github.com/jprante/elasticsearch-jdbc/