I was thinking of using a REST Resource, but it seems like that Matrix doesn’t allow to use “Request Body” with the GET verb.
Is jQuery AJAX my only option? I am looking to avoid it if possible due to cross domain issues. I know JSONP can help, but this will be the last option.
Hi Bart, thanks again for your reply. ElasticSearch does support passing data using standard URL GET parameters, but its a very limited subset of what you can send in GET message body.
For example constructing queries like this and this using standard URL GET parameters would be a pain in the back. That is why they recommend sending queries in message body. Their reasoning/advantage maybe is that it allows easily sending XML or JSON request bodies containing complex nested queries, it doesn’t have a length restriction and it’s easier to encode (UTF-8).
Also, upon further investigation, I came across this old document, which states that Elastic does support POST request with message body, if sending a GET request with message body is not feasible. This is for an older version of Elastic, not sure if the latest version (5.1) that I am using also support this. I gotta do some testing …