0

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?

Nkosi
  • 235,767
  • 35
  • 427
  • 472
ssaxena
  • 21
  • 2

1 Answers1

0

I reached out to searchly.com support team. They responded with the answer that JestClient 5.3.4 may not work well with ES 6.5.3 and recommended to use latest version 6.3.1.

I tried and JestClient 6.3.1 works with ElasticSearch 6.5.4.

Thanks

ssaxena
  • 21
  • 2