elasticsearch-codeigniter-library
elasticsearch-codeigniter-library copied to clipboard
Rewrite to not depend on cURL?
There is an offical way of a PHP class, full example from website is quoted:
$esclient = Elasticsearch\ClientBuilder::create()
->setHosts(["localhost:9200"])
->build();
$params = [
'index' => 'social-*',
'body' => [
'query' => [
'match' => [ 'message' => 'myProduct' ]
],
'aggs' => [
'top_10_states' => [
'terms' => [
'field' => 'state',
'size' => 10,
]
]
]
]
];
$response = $esclient->search($params);
Documentation: https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html