Question

I am using elastica to search in elasticsearch index on windows azure linux virtual machine. I created the index using JAVA API of elastic search:-

IndexResponse response = client.prepareIndex("nod", "rel").setSource(met.xb).execute().actionGet();

This is how I am trying to connect & search:-

$elasticaClient = new Elastica_Client(array(
                    'host' => 'localhost',
                    'port' => '9200'
                ));
$result= $elasticaClient->request("nod/rel/_search", "GET",$dt)

It just prints word "Array" on the output php page.

var_dump($elasticaClient) prints this:-

object(Elastica_Client)#2 (1) { ["_config":protected]=> array(13) { ["host"]=> string(9) "localhost" ["port"]=> string(4) "9200" ["path"]=> string(0) "" ["url"]=> NULL ["transport"]=> string(4) "Http" ["persistent"]=> bool(true) ["timeout"]=> int(300) ["headers"]=> array(0) { } ["servers"]=> array(0) { } ["curl"]=> array(0) { } ["roundRobin"]=> bool(false) ["log"]=> bool(false) ["retryOnConflict"]=> int(0) } }

var_dump($result) prints nothing.

Can someone help me out here?

Was it helpful?

Solution 2

Check out sample PHP-Elastica application here; https://github.com/searchbox-io/php-elastica-sample

OTHER TIPS

@ferhat....Thnx for the link. However, the error I was getting was because php5-curl was not installed in the system.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top