Curl -xget works, but fail when use RESTful client in java

2014-08-01 Thread Chia-Eng Chang
I tried to send http/get to my elasticsearch server.if I query: curl 'http://localhost:9200/index/_search?scroll=1msize=50pretty' -d '{query : {match_all : {}}}' it works perfect. But when I tried to use jersy to build my client, I did the follwoing: public class

Re: Curl -xget works, but fail when use RESTful client in java

2014-08-01 Thread Chia-Eng Chang
Got the answer! It turns out that just add an between the url and encoded json body. String string1={\query\ : {\match_all\ : {}}}; WebResource webResource = client .resource(http://localhost:9200/obd2/_search?scroll=1msize=50+ URLEncoder.encode(string1)); then the http/get was successfully