Analyze method error


(Aarthini) #1

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 "


(David Pilato) #2

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

?


(system) #3

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