I am using jest client analyze function to analyze text. I am using Jest client version 5.3.4 and ES 6.5.4. Here is the code:
Analyze.Builder AnalyzeBuilder = new Analyze.Builder().index(index.name).text(textToAnalyze).analyzer(analyzer);
JestResult jestResult = null;
JestClient client = getClient(index.cluster); // fetches client from the pool
Analyze analyze = AnalyzeBuilder.build();
System.out.println(analyze.toString());
jestResult = client.execute(analyze);
System.out.println(jestResult.getJsonString());
assertNotNull(jestResult);
assertTrue(jestResult.isSucceeded());
It returns with below response:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/mytest-ff3f0473-e20e-4926-b983-4cf466b0b397/_analyze] contains unrecognized parameter: [analyzer]"}],"type":"illegal_argument_exception","reason":"request [/mytest-ff3f0473-e20e-4926-b983-4cf466b0b397/_analyze] contains unrecognized parameter: [analyzer]"},"status":400}
Here is the toString output of "analyze" variable.
Analyze{uri=mytest-ff3f0473-e20e-4926-b983-4cf466b0b397/_analyze?analyzer=multilingual_english, method=POST}
It seems "analyzer" parameter in the query string no longer works. It works when sent it in the JSON. Below query works.
{"analyzer" : "standard", "text" : "while processing data"}
Is there any way to force JestClient to send analyzer parameter in the JSON?