elasticsearch-codeigniter-library icon indicating copy to clipboard operation
elasticsearch-codeigniter-library copied to clipboard

Rewrite to not depend on cURL?

Open Quix0r opened this issue 8 years ago • 0 comments

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

Quix0r avatar Jun 14 '17 09:06 Quix0r