PDA

View Full Version : Elasticsearch and Extjs 4.2.1 : Curl and "--data" json object arguments



Tchinkatchuk
29 Oct 2013, 8:56 AM
Hi,

I am benchmarking Extjs with ElasticSearch.
My curl command is this one :


curl -XGET '<myhost>:<myport>/<myindex>/_search' -d '{
"facets": {
"name": {
"terms": {
"field": "name"
}
}
}
}'


No cors issue & very good respond time, so I really do not want to pass via a server side script just in order to implement the curl call.

The issue is the "data" in curl implementation cause it is a json object and proxies in extjs just do not manage it with extraParams (for what I have seen)

Does anyone has a clue on this ?
I have tried multiple stuff without success but perhaps I have just missed the solution.

Thanks.

Sylvain

Gary Schlosberg
1 Nov 2013, 5:18 AM
Not sure if you'll be able to use GET but if so you might need to flatten the JSON and pass as a string. If you can use POST, this might be the solution:
http://stackoverflow.com/questions/5658510/curl-json-post-request-via-terminal-to-a-rails-app