How to fix a URI does not indicate a valid hostname in a ClientProtocolException:

Hey. When I run the java API to find elasticity using the jest client, I encounter the following error.

org.apache.http.client.ClientProtocolException: URI does not indicate a valid hostname: localhost: 9200 / index / type / _search

I try to use various features to fix this error, but it does not work, and no one will help me fix it. Thanks in advance.

+8
java elasticsearch jest
source share
1 answer

You just need to add http:// to the top of the URI.

+22
source share

All Articles