Using with PHP
A sample PHP application can be found on GitHub https://github.com/searchly/searchly-php-sample.
Documentation targets official PHP client for Elasticsearch
Add elasticsearch client dependency to your composer.json file and ;
Update application dependencies with composer;
$ php composer.phar install
$params['hosts'] = array (
$client = new Elasticsearch\Client($params);
$indexParams['index'] = 'sample';
Index a document;
$document = array(
name => 'Reliability',
text => 'Reliability is improved if multiple redundant sites are used, which makes well-designed cloud computing suitable for business continuity.'
$params = array();
$params['body'] = $document;
$params['index'] = 'sample';
$params['type'] = 'document';
You can search indexed document as:
$searchParams['body']['query']['match']['text'] = 'Reliability';
$results = $client->search($searchParams);
PHP client has very detailed documentation at official Elasticsearch site.