Hi,
I'm trying to figure how I can create a jax-rs REST call to search elastic search using a stored template.
for the moment I'm doing a POST , using the http body to put the data in. Somehting like this :
POST http://1.2.3.4:9200/index/type/_search/template
and as a body :
{
"file": "count",
"params": {
"grp_by_field": "objecttype.keyword"
}
}
where count is the moustache file. Is this correct ? This works in jmeter, but I'm getting a http 400 status back when
executing this using jax-rs :
String queryString="{ "file": "count" , "params": { "grp_by_field"="objecttype.keyword" } }";
Response r = client
.target("http://1.2.3.4:9200")
.path("/index/type/_search/template")
.request(MediaType.APPLICATION_JSON)
.post(Entity.json(queryString));
In any case, it doesn't feel right to do a POST when querying data... Any ideas on how to do this ?
tnx,
Chris