Hilal
(Hilal)
March 28, 2016, 12:56pm
1
Hi,
I am using Elasticsearcj 2.2.0, Kİbana 4.4.2, Shield 2.2.0 and php 5.4.45
Should I update my php client?
For example : I am using this code: $client = new Elasticsearch\Client();
but it should be $client = ClientBuilder::create()->build();
When I write$client = ClientBuilder::create()->build();
it dosen't work true.
Actually my Elasticsearch the is up to date. What can I do?
Try this ---
$client = \Elasticsearch\ClientBuilder::create() ->setHosts([your host name])->build();
or may be your are not loading ur autoload.php file .
Hilal
(Hilal)
March 28, 2016, 1:08pm
3
I did but:
error:
Class 'Elasticsearch\ClientBuilder' not found
check on 9200 port if ur elastic search even running or not.
e.g. http://localhost:9200/
will be response like
{
"name" : "Firelord",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.2.1",
"build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
"build_timestamp" : "2016-03-09T09:38:54Z",
"build_snapshot" : false,
"lucene_version" : "5.4.1"
},
"tagline" : "You Know, for Search"
}
Hilal
(Hilal)
March 28, 2016, 1:25pm
5
I did:
{
"name": "Adrian Toomes",
"cluster_name": "elasticsearch",
"version":
{
"number": "2.2.0",
"build_hash": "8ff36d139e16f8720f2947ef62c8167a888992fe",
"build_timestamp": "2016-01-27T13:32:39Z",
"build_snapshot": false,
"lucene_version": "5.4.1"
},
"tagline": "You Know, for Search"
}
I dunno If you have seen this.
Hilal
(Hilal)
March 28, 2016, 1:46pm
7
<?php
require 'vendor/autoload.php';
use Elasticsearch\ClientBuilder;
$client = ClientBuilder::create()->build();
I wrote this code but I have same error