如何修复URI未在ClientProtocolException中指定有效的主机名:

时间:2015-10-01 09:27:19

标签: java elasticsearch jest

嗨当我使用jest客户端执行弹性搜索java API时,我面临以下错误

  

org.apache.http.client.ClientProtocolException:URI未指定有效的主机名:localhost:9200 / index / type / _search

我尝试了各种可能性来解决这个错误,但它不会有任何人指导我解决这个问题吗?。提前谢谢。

1 个答案:

答案 0 :(得分:30)

您只需要在URI的开头添加http://