I have a curl request which i need to call from my java code.
curl -XGET 'abc.com:9200/datafinal/map/_search' -d '
{
"query": {
"filtered": {
"query": {
"match": { "ORIG_PROVIDER_ID": 1 }
},
"filter": {
"range": { "TRANSACT_DATE": { "gte": "2015-01-01 00:00:00.0" ,"lte": "2015-01-10 00:00:00.0"}}
}
}
},
"aggs" : {
"amount_sum" : { "sum" : { "field" : "TOTAL_AMT" } }
}
}
'
This is the curl request. how can i call it from java code? To form this exact code with httpurlconnection in java looks like a tough job with the request body.