0

Windows Azure Linux仮想マシンでelasticaを使用してelasticsearchインデックスを検索しています。弾性検索の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) は何も出力しません。

誰かがここで私を助けてくれますか?

4

2 に答える 2

0

サンプルの PHP-Elastica アプリケーションをこちらで確認してください。 https://github.com/searchbox-io/php-elastica-sample

于 2012-12-07T13:08:28.003 に答える