【Elasticsearch】 Elasticsearch - php

1、新建一个文件夹取名为elasticSearch

2、创建一个名为composer.json的文件,内容

1 {
2          "require": {
3               "elasticsearch/elasticsearch": "~5.1.1"
4          }
5 }

3、下载安装Composer

curl -s http://getcomposer.org/installer | php

4、安装elasticsearch-php

php composer.phar install --no-dev

5、demo

1 <?php
2 
3     use Elasticsearch\ClientBuilder;
4 
5     require 'vendor/autoload.php';
6 
7     $client = ClientBuilder::create()->build();

 

posted @ 2017-02-15 10:50  蓝色星辰1993  阅读(138)  评论(0编辑  收藏  举报