我正在使用elastica在windows azure linux虚拟机上搜索elasticsearch索引。我使用elastic search的JAVA API创建了索引:
IndexResponse response = client.prepareIndex("nod", "rel").setSource(met.xb).execute().actionGet();这是我尝试连接和搜索的方式:
$elasticaClient = new Elastica_Client(array(
'host' => 'localhost',
'port' => '9200'
));
$result= $elasticaClient->request("nod/rel/_search", "GET",$dt)它只是在输出的php页面上打印单词"Array“。
var_dump($elasticaClient)打印以下内容:-
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)不打印任何内容。
有人能帮帮我吗?
发布于 2012-12-07 21:08:28
在这里查看示例PHP-Elastica应用程序;https://github.com/searchbox-io/php-elastica-sample
发布于 2012-12-09 05:58:40
链接的@ferhat....Thnx。然而,我得到的错误是因为系统中没有安装php5-curl。
https://stackoverflow.com/questions/13599625
复制相似问题