How can I run Elastic Search 5.0 in embed mode?

No just jUnit test. I have a application focus on storage on local disk, in order to find data quickly, I write byte[] into file, and save file_name, offset, length of the data into de es. Most important, the process of my app and the process of es is 1:1. So es is not in cluster mode, and no need in cluster mode.

Now I use a network api to save data, but I think this is not efficient enough. So I look the better way to do so.

Does anyone have better ideas?