基本 环境:
ubuntu:12.04 LTS
php 5.5.13
elasticsearch1.2.2(目前最新版)
1.安装官api SDK
mkdir -p /data/wordspace/es
vi composer.json
{
"require": {
"elasticsearch/elasticsearch": "~1.0"
}
}
curl -s http://getcomposer.org/installer | php
php composer.phar install
#新建文件引入sdk即可
require 'vendor/autoload.php';
$client = new Elasticsearch\Client();
var_dump($client);