javaelasticsearchelasticsearch-jest

How to fix the URI does not specify a valid host name in ClientProtocolException:


When I execute the elastic search java API using jest client, I face the following error

org.apache.http.client.ClientProtocolException: URI does not specify a valid host name:localhost:9200/index/type/_search

I tries various possibilities to fix this error, but I am stuck. How can I fix this?


Solution

  • You just need to add http:// at the beginning of the URI.