Analyze method error

Header[] headers = {new BasicHeader("authorization", "Basic ZWxhc3RpYzplbGFzdGlj")};
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(
new HttpHost("ip", 9200, "http")));
String jsonString = "{"analyzer":"my_analyzer","text":"cat on the wall"}";
HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON);
Response response = client.getLowLevelClient().performRequest("GET", "tweet/_analyze, Collections.emptyMap(), entity);
client.close();

while using this I m getting error "type":"security_exception","reason":"missing authentication token for REST request "

Did you read https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_basic_authentication.html

?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.