org.elasticsearch.client.ResponseException: GET http://localhost:9200/_hello?name=005f3370-4626-4309-92a5-def32fae7e87: HTTP/1.1 400 Bad Request
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/_hello] contains unrecognized parameter: [name]"}],"type":"illegal_argument_exception","reason":"request [/_hello] contains unrecognized parameter: [name]"},"status":400}
How can I correctly register my REST endpoint to handle query parameters? Note: I've also tried to register only controller.registerHandler(GET, "/_hello/{name}", this); but got the same error.
Judging from this error message, you don't read the "name" parameter when processing the incoming request. This is usually done via RestRequest#param(parameterName) somewhere in your implementation of BaseRestHandler#prepareRequest().
Thanks for your answer. My Elasticsearch version is 5.1.2. I get what was wrong with my code. I was dealing with parameters inside lambda like this one:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.