Elasticsearch is a Web API, as explained here.
To get access to Elasticsearch from the php plugin code, we could have built our own http library, but it would have been crazy.
Instead, we are using the Elastica php Elasticsearch client library. It is a fine object oriented code which takes care of wrapping/unwrapping php objects to and from json over http. We did not use the official Elasticsearch php library, because it’s too low level.
If you want to learn more, here are some documentations: