Can anyone help me to convert the following into java equivalent?
curl -XGET 'localhost:9200/indexname/status/_search?pretty=1&size=10000' -d '{"_source": {"include": [ "ID", "Name" ]}}'
I tried to use this:
ProcessBuilder pb = new ProcessBuilder("curl","-g","-H Content-Type: application/json", "-H Accept: application/json", "-XGET","http://localhost:9200/indexname/status/_search?pretty=1&size=10000","-d '{\"_source\": {\"include\": [ \"ID\", \"Name\" ]}}'");
On running the java code, it return a Parse failure exception. Any advice? Thanks.