简体   繁体   English

在Windows Xampp上安装和使用elasticsearch php客户端

[英]Installation and using elasticsearch php client on Windows Xampp

I'm downloaded the elasticsearch-5.1.1.zip from the https://www.elastic.co/downloads/elasticsearch 我从https://www.elastic.co/downloads/elasticsearch下载了elasticsearch-5.1.1.zip

Then download the Elastica A PHP client for elasticsearch via composer with this command 然后使用此命令通过composer下载用于elasticsearch的Elastica A PHP客户端

composer require ruflin/elastica:dev-master 作曲家需要ruflin / elastica:dev-master

Now i want to open and make a test. 现在我想打开并进行测试。 When i run this command 当我运行此命令

bin\\elasticsearch.bat BIN \\ elasticsearch.bat

i get this error: The syntax of the command is incorrect. 我收到此错误: 命令的语法不正确。

On the other side if i try to use Elastica A PHP client i get some errors like this: 另一方面,如果我尝试使用Elastica A PHP客户端,我会遇到如下错误:

Fatal error: Uncaught Elastica\\Exception\\Connection\\HttpException: Couldn't connect to host, Elasticsearch down? 致命错误:未捕获Elastica \\ Exception \\ Connection \\ HttpException:无法连接到主机,Elasticsearch下来? in E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Transport\\Http.php:180 Stack trace: #0 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Request.php(171): Elastica\\Transport\\Http->exec(Object(Elastica\\Request), Array) #1 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Client.php(662): Elastica\\Request->send() #2 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Client.php(673): Elastica\\Client->request('twitter/', 'DELETE', Array, Array) #3 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Index.php(531): Elastica\\Client->request('twitter/', 'DELETE', Array, Array) #4 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Index.php(165): Elastica\\Index->request('twitter/', 'DELETE') #5 E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Index.php(258): Elastica\\Index->delete() #6 E:\\xampp\\htdocs\\el\\index.php(40): Elastica\\Index->create(Array, true) #7 {main} thrown in E:\\xampp\\htdocs\\el\\vendor\\ruflin\\elastica\\lib\\Elastica\\Transport\\Http.php on line 18 在E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Transport \\ Http.php:180堆栈跟踪:#0 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Request.php(171):Elastica \\ Transport \\ Http-> exec(Object(Elastica \\ Request),Array)#1 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Client.php (662):Elastica \\ Request-> send()#2 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Client.php(673):Elastica \\ Client-> request('twitter / ','DELETE',Array,Array)#3 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Index.php(531):Elastica \\ Client-> request('twitter /', 'DELETE',Array,Array)#4 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Index.php(165):Elastica \\ Index->​​ request('twitter /','DELETE ')#5 E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Index.php(258):Elastica \\ Index->​​ delete()#6 E:\\ xampp \\ htdocs \\ el \\ index .php(40):Elastica \\ Index->​​ create(Array,true)#7 {main}抛出E:\\ xampp \\ htdocs \\ el \\ vendor \\ ruflin \\ elastica \\ lib \\ Elastica \\ Transport \\ Http.php on line 18 0 0

My question is How can i work with elasticsearch-5.1? 我的问题是我如何使用elasticsearch-5.1? Where am i do wrong? 我哪里做错了?

Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM