Java client usage

Can someone explain the best way to use ES from a java application ?

  • Use HttpClient to connect to the server and send json requests

  • Use the java API

I am confused on how the java API should be used. My understanding is that you can package the client with an application as an embeded search server ?

Thanks for this clarification