# Inconsistent results with space'd values over TCP vs. HTTP

**URL:** <https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683>\
**Category:** Elasticsearch\
**Created:** [October 25, 2011, 10:59pm UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683 "2011-10-25T22:59:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish\_Pandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_pandit/32/3000_2.png) [@Manish\_Pandit](https://discuss.elastic.co/u/Manish_Pandit)\
**Post date:** [October 25, 2011, 10:59pm UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/1 "2011-10-25T22:59:48Z")

</div>

Hi there,

Here is the query that we're sending to an Elastic Search Index via  
the Java Driver, TCP Port 9300.

{  
"from" : 0,  
"size" : 20,  
"query" : {  
"match\_all" : {  
}  
},  
"filter" : {  
"and" : {  
"filters" : [ {  
"term" : {  
"metadata.prime" : false  
}  
}, {  
"range" : {  
"metadata.publishDate" : {  
"from" : 1288047197219,  
"to" : 1319583197219,  
"include\_lower" : true,  
"include\_upper" : false  
}  
}  
}, {  
"or" : {  
"filters" : [ {  
"term" : {  
"metadata.state" : "published"  
}  
} ]  
}  
}, {  
"and" : {  
"filters" : [ {  
"term" : {  
"metadata.name" : "call of duty"  
}  
} ]  
}  
} ]  
}  
},  
"fields" : [],  
"sort" : [ {  
"metadata.publishDate" : {  
"order" : "desc"  
}  
} ]  
}

This query returns Zero hits. At the same time, when I submit this  
query (via HTTP GET on port 9200) on the \_search endpoint of that  
index, I get results as expected.

This is happening when any of the values have spaces in them (please  
note metadata.name as "call of duty"). If the values do not have  
spaces, the queries sent through the TCP Connection work just as good  
as them over HTTP.

This has put us in a fix - should we send all queries over HTTP and  
then parse the results (much cumbersome), or is there something we are  
missing while we are sending this query through the Java Driver as

```
   val result = query.execute.actionGet()

```

Please let me know. I'd appreciate any hints or pointers.

-cheers,  
Manish

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 26, 2011, 3:12am UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/2 "2011-10-26T03:12:22Z")

</div>

Thats strange..., how are you executing the search request using the Java  
API? The Java API ends up building the same query structure as the rest API.

On Wed, Oct 26, 2011 at 12:59 AM, Manish Pandit [pandit.manish@gmail.com](mailto:pandit.manish@gmail.com)wrote:

> Hi there,
> 
> Here is the query that we're sending to an Elastic Search Index via  
> the Java Driver, TCP Port 9300.
> 
> {  
> "from" : 0,  
> "size" : 20,  
> "query" : {  
> "match\_all" : {  
> }  
> },  
> "filter" : {  
> "and" : {  
> "filters" : [ {  
> "term" : {  
> "metadata.prime" : false  
> }  
> }, {  
> "range" : {  
> "metadata.publishDate" : {  
> "from" : 1288047197219,  
> "to" : 1319583197219,  
> "include\_lower" : true,  
> "include\_upper" : false  
> }  
> }  
> }, {  
> "or" : {  
> "filters" : [ {  
> "term" : {  
> "metadata.state" : "published"  
> }  
> } ]  
> }  
> }, {  
> "and" : {  
> "filters" : [ {  
> "term" : {  
> "metadata.name" : "call of duty"  
> }  
> } ]  
> }  
> } ]  
> }  
> },  
> "fields" : ,  
> "sort" : [ {  
> "metadata.publishDate" : {  
> "order" : "desc"  
> }  
> } ]  
> }
> 
> This query returns Zero hits. At the same time, when I submit this  
> query (via HTTP GET on port 9200) on the \_search endpoint of that  
> index, I get results as expected.
> 
> This is happening when any of the values have spaces in them (please  
> note metadata.name as "call of duty"). If the values do not have  
> spaces, the queries sent through the TCP Connection work just as good  
> as them over HTTP.
> 
> This has put us in a fix - should we send all queries over HTTP and  
> then parse the results (much cumbersome), or is there something we are  
> missing while we are sending this query through the Java Driver as
> 
> ```
> val result = query.execute.actionGet()
> 
> ```
> 
> Please let me know. I'd appreciate any hints or pointers.
> 
> -cheers,  
> Manish

---

<div class="post-metadata">

**Author:** ![Manish\_Pandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_pandit/32/3000_2.png) [@Manish\_Pandit](https://discuss.elastic.co/u/Manish_Pandit)\
**Post date:** [October 26, 2011, 4:15am UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/3 "2011-10-26T04:15:13Z")

</div>

On Oct 25, 8:12 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Thats strange..., how are you executing the search request using the Java  
> API? The Java API ends up building the same query structure as the rest API.
> 
> On Wed, Oct 26, 2011 at 12:59 AM, Manish Pandit [pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)wrote:
> 
> > Hi there,
> 
> > Here is the query that we're sending to an Elastic Search Index via  
> > the Java Driver, TCP Port 9300.
> 
> > {  
> > "from" : 0,  
> > "size" : 20,  
> > "query" : {  
> > "match\_all" : {  
> > }  
> > },  
> > "filter" : {  
> > "and" : {  
> > "filters" : [ {  
> > "term" : {  
> > "metadata.prime" : false  
> > }  
> > }, {  
> > "range" : {  
> > "metadata.publishDate" : {  
> > "from" : 1288047197219,  
> > "to" : 1319583197219,  
> > "include\_lower" : true,  
> > "include\_upper" : false  
> > }  
> > }  
> > }, {  
> > "or" : {  
> > "filters" : [ {  
> > "term" : {  
> > "metadata.state" : "published"  
> > }  
> > } ]  
> > }  
> > }, {  
> > "and" : {  
> > "filters" : [ {  
> > "term" : {  
> > "metadata.name" : "call of duty"  
> > }  
> > } ]  
> > }  
> > } ]  
> > }  
> > },  
> > "fields" : ,  
> > "sort" : [ {  
> > "metadata.publishDate" : {  
> > "order" : "desc"  
> > }  
> > } ]  
> > }
> 
> > This query returns Zero hits. At the same time, when I submit this  
> > query (via HTTP GET on port 9200) on the \_search endpoint of that  
> > index, I get results as expected.
> 
> > This is happening when any of the values have spaces in them (please  
> > note metadata.name as "call of duty"). If the values do not have  
> > spaces, the queries sent through the TCP Connection work just as good  
> > as them over HTTP.
> 
> > This has put us in a fix - should we send all queries over HTTP and  
> > then parse the results (much cumbersome), or is there something we are  
> > missing while we are sending this query through the Java Driver as
> 
> > ```
> > val result = query.execute.actionGet()
> > 
> > ```
> 
> > Please let me know. I'd appreciate any hints or pointers.
> 
> > -cheers,  
> > Manish

Hi Shay - Thanks for your reply

Exactly! I am building the query using the SearchBuilder - like this:

```
val query = new

```

SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).

setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfiguration.indexName).  
setTypes(cf.searchConfiguration.videoModel).addSort(sort,  
if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)  
query.setFilter(superFilter)

Where I am adding more filters (as you can see from the output). At  
the end I log the query variable, which renders the JSON that I pasted  
above.

Next I do this :

```
    val result = query.execute.actionGet()

```

Which returns me no results. However, when I paste the JSON produced  
as the value of query, (on the server:9200/index/type/\_search) I am  
able to see the results. This is only happening when any of the values  
contains a space. If there are no spaces, it works great via the Java  
driver as well as HTTP.

Now I am trying to use Apache Commons HTTP Client to send the same  
JSON over HTTP, but the client libraries do not support sending a body  
with GET request. Sending the same on POST does not work obviously.  
Next attempt would be to use Java's HttpURLConnection and hopefully  
that'd let me send a payload over GET but if that too doesn't work, I  
really am out of options ☹

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 26, 2011, 4:21am UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/4 "2011-10-26T04:21:59Z")

</div>

I think that there is something wrong with how you execute the search many  
using the Java API, I am still missing the complete picture. Obviously,  
something is strange here. If you can creata a simple test program, that  
also initializes the index with some data, to show the failure, I will be  
happy to look at it.

Regarding using the REST API, you can use POST as well to execute search,  
not just GET. But, I think that you are giving up on the Java API too  
fast...

On Wed, Oct 26, 2011 at 6:15 AM, Manish Pandit [pandit.manish@gmail.com](mailto:pandit.manish@gmail.com)wrote:

> On Oct 25, 8:12 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > Thats strange..., how are you executing the search request using the Java  
> > API? The Java API ends up building the same query structure as the rest  
> > API.
> > 
> > On Wed, Oct 26, 2011 at 12:59 AM, Manish Pandit \<[pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)  
> > wrote:
> > 
> > > Hi there,
> > 
> > > Here is the query that we're sending to an Elastic Search Index via  
> > > the Java Driver, TCP Port 9300.
> > 
> > > {  
> > > "from" : 0,  
> > > "size" : 20,  
> > > "query" : {  
> > > "match\_all" : {  
> > > }  
> > > },  
> > > "filter" : {  
> > > "and" : {  
> > > "filters" : [ {  
> > > "term" : {  
> > > "metadata.prime" : false  
> > > }  
> > > }, {  
> > > "range" : {  
> > > "metadata.publishDate" : {  
> > > "from" : 1288047197219,  
> > > "to" : 1319583197219,  
> > > "include\_lower" : true,  
> > > "include\_upper" : false  
> > > }  
> > > }  
> > > }, {  
> > > "or" : {  
> > > "filters" : [ {  
> > > "term" : {  
> > > "metadata.state" : "published"  
> > > }  
> > > } ]  
> > > }  
> > > }, {  
> > > "and" : {  
> > > "filters" : [ {  
> > > "term" : {  
> > > "metadata.name" : "call of duty"  
> > > }  
> > > } ]  
> > > }  
> > > } ]  
> > > }  
> > > },  
> > > "fields" : ,  
> > > "sort" : [ {  
> > > "metadata.publishDate" : {  
> > > "order" : "desc"  
> > > }  
> > > } ]  
> > > }
> > 
> > > This query returns Zero hits. At the same time, when I submit this  
> > > query (via HTTP GET on port 9200) on the \_search endpoint of that  
> > > index, I get results as expected.
> > 
> > > This is happening when any of the values have spaces in them (please  
> > > note metadata.name as "call of duty"). If the values do not have  
> > > spaces, the queries sent through the TCP Connection work just as good  
> > > as them over HTTP.
> > 
> > > This has put us in a fix - should we send all queries over HTTP and  
> > > then parse the results (much cumbersome), or is there something we are  
> > > missing while we are sending this query through the Java Driver as
> > 
> > > ```
> > > val result = query.execute.actionGet()
> > > 
> > > ```
> > 
> > > Please let me know. I'd appreciate any hints or pointers.
> > 
> > > -cheers,  
> > > Manish
> 
> Hi Shay - Thanks for your reply
> 
> Exactly! I am building the query using the SearchBuilder - like this:
> 
> val query = new  
> SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
> 
> setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfiguration.indexName).  
> setTypes(cf.searchConfiguration.videoModel).addSort(sort,  
> if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)  
> query.setFilter(superFilter)
> 
> Where I am adding more filters (as you can see from the output). At  
> the end I log the query variable, which renders the JSON that I pasted  
> above.
> 
> Next I do this :
> 
> ```
> val result = query.execute.actionGet()
> 
> ```
> 
> Which returns me no results. However, when I paste the JSON produced  
> as the value of query, (on the server:9200/index/type/\_search) I am  
> able to see the results. This is only happening when any of the values  
> contains a space. If there are no spaces, it works great via the Java  
> driver as well as HTTP.
> 
> Now I am trying to use Apache Commons HTTP Client to send the same  
> JSON over HTTP, but the client libraries do not support sending a body  
> with GET request. Sending the same on POST does not work obviously.  
> Next attempt would be to use Java's HttpURLConnection and hopefully  
> that'd let me send a payload over GET but if that too doesn't work, I  
> really am out of options ☹

---

<div class="post-metadata">

**Author:** ![Manish\_Pandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_pandit/32/3000_2.png) [@Manish\_Pandit](https://discuss.elastic.co/u/Manish_Pandit)\
**Post date:** [October 26, 2011, 4:24am UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/5 "2011-10-26T04:24:45Z")

</div>

On Oct 25, 9:21 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> I think that there is something wrong with how you execute the search many  
> using the Java API, I am still missing the complete picture. Obviously,  
> something is strange here. If you can creata a simple test program, that  
> also initializes the index with some data, to show the failure, I will be  
> happy to look at it.
> 
> Regarding using the REST API, you can use POST as well to execute search,  
> not just GET. But, I think that you are giving up on the Java API too  
> fast...
> 
> On Wed, Oct 26, 2011 at 6:15 AM, Manish Pandit [pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)wrote:
> 
> > On Oct 25, 8:12 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > Thats strange..., how are you executing the search request using the Java  
> > > API? The Java API ends up building the same query structure as the rest  
> > > API.
> 
> > > On Wed, Oct 26, 2011 at 12:59 AM, Manish Pandit \<[pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)  
> > > wrote:
> 
> > > > Hi there,
> 
> > > > Here is the query that we're sending to an Elastic Search Index via  
> > > > the Java Driver, TCP Port 9300.
> 
> > > > {  
> > > > "from" : 0,  
> > > > "size" : 20,  
> > > > "query" : {  
> > > > "match\_all" : {  
> > > > }  
> > > > },  
> > > > "filter" : {  
> > > > "and" : {  
> > > > "filters" : [ {  
> > > > "term" : {  
> > > > "metadata.prime" : false  
> > > > }  
> > > > }, {  
> > > > "range" : {  
> > > > "metadata.publishDate" : {  
> > > > "from" : 1288047197219,  
> > > > "to" : 1319583197219,  
> > > > "include\_lower" : true,  
> > > > "include\_upper" : false  
> > > > }  
> > > > }  
> > > > }, {  
> > > > "or" : {  
> > > > "filters" : [ {  
> > > > "term" : {  
> > > > "metadata.state" : "published"  
> > > > }  
> > > > } ]  
> > > > }  
> > > > }, {  
> > > > "and" : {  
> > > > "filters" : [ {  
> > > > "term" : {  
> > > > "metadata.name" : "call of duty"  
> > > > }  
> > > > } ]  
> > > > }  
> > > > } ]  
> > > > }  
> > > > },  
> > > > "fields" : ,  
> > > > "sort" : [ {  
> > > > "metadata.publishDate" : {  
> > > > "order" : "desc"  
> > > > }  
> > > > } ]  
> > > > }
> 
> > > > This query returns Zero hits. At the same time, when I submit this  
> > > > query (via HTTP GET on port 9200) on the \_search endpoint of that  
> > > > index, I get results as expected.
> 
> > > > This is happening when any of the values have spaces in them (please  
> > > > note metadata.name as "call of duty"). If the values do not have  
> > > > spaces, the queries sent through the TCP Connection work just as good  
> > > > as them over HTTP.
> 
> > > > This has put us in a fix - should we send all queries over HTTP and  
> > > > then parse the results (much cumbersome), or is there something we are  
> > > > missing while we are sending this query through the Java Driver as
> 
> > > > ```
> > > > val result = query.execute.actionGet()
> > > > 
> > > > ```
> 
> > > > Please let me know. I'd appreciate any hints or pointers.
> 
> > > > -cheers,  
> > > > Manish
> 
> > Hi Shay - Thanks for your reply
> 
> > Exactly! I am building the query using the SearchBuilder - like this:
> 
> > val query = new  
> > SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
> 
> > setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfig uration.indexName).  
> > setTypes(cf.searchConfiguration.videoModel).addSort(sort,  
> > if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)  
> > query.setFilter(superFilter)
> 
> > Where I am adding more filters (as you can see from the output). At  
> > the end I log the query variable, which renders the JSON that I pasted  
> > above.
> 
> > Next I do this :
> 
> > ```
> > val result = query.execute.actionGet()
> > 
> > ```
> 
> > Which returns me no results. However, when I paste the JSON produced  
> > as the value of query, (on the server:9200/index/type/\_search) I am  
> > able to see the results. This is only happening when any of the values  
> > contains a space. If there are no spaces, it works great via the Java  
> > driver as well as HTTP.
> 
> > Now I am trying to use Apache Commons HTTP Client to send the same  
> > JSON over HTTP, but the client libraries do not support sending a body  
> > with GET request. Sending the same on POST does not work obviously.  
> > Next attempt would be to use Java's HttpURLConnection and hopefully  
> > that'd let me send a payload over GET but if that too doesn't work, I  
> > really am out of options ☹

Hi Shay - Let me take another look at what is going on with my Java  
Client. I'll probably put a test code with mapping file etc. on my  
private repo on github and give you access to it if that helps.

Thanks again - We plan to put Elastic in Production as early as next  
month, and except for this everything else has been sailing super  
smooth 🙂

-cheers,  
Manish

---

<div class="post-metadata">

**Author:** ![Manish\_Pandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_pandit/32/3000_2.png) [@Manish\_Pandit](https://discuss.elastic.co/u/Manish_Pandit)\
**Post date:** [October 26, 2011, 11:31pm UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/6 "2011-10-26T23:31:56Z")

</div>

On Oct 25, 9:24 pm, Manish Pandit [pandit.man...@gmail.com](mailto:pandit.man...@gmail.com) wrote:

> On Oct 25, 9:21 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > I think that there is something wrong with how you execute the search many  
> > using the Java API, I am still missing the complete picture. Obviously,  
> > something is strange here. If you can creata a simple test program, that  
> > also initializes the index with some data, to show the failure, I will be  
> > happy to look at it.
> 
> > Regarding using the REST API, you can use POST as well to execute search,  
> > not just GET. But, I think that you are giving up on the Java API too  
> > fast...
> 
> > On Wed, Oct 26, 2011 at 6:15 AM, Manish Pandit [pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)wrote:
> 
> > > On Oct 25, 8:12 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > > 
> > > > Thats strange..., how are you executing the search request using the Java  
> > > > API? The Java API ends up building the same query structure as the rest  
> > > > API.
> 
> > > > On Wed, Oct 26, 2011 at 12:59 AM, Manish Pandit \<[pandit.man...@gmail.com](mailto:pandit.man...@gmail.com)  
> > > > wrote:
> 
> > > > > Hi there,
> 
> > > > > Here is the query that we're sending to an Elastic Search Index via  
> > > > > the Java Driver, TCP Port 9300.
> 
> > > > > {  
> > > > > "from" : 0,  
> > > > > "size" : 20,  
> > > > > "query" : {  
> > > > > "match\_all" : {  
> > > > > }  
> > > > > },  
> > > > > "filter" : {  
> > > > > "and" : {  
> > > > > "filters" : [ {  
> > > > > "term" : {  
> > > > > "metadata.prime" : false  
> > > > > }  
> > > > > }, {  
> > > > > "range" : {  
> > > > > "metadata.publishDate" : {  
> > > > > "from" : 1288047197219,  
> > > > > "to" : 1319583197219,  
> > > > > "include\_lower" : true,  
> > > > > "include\_upper" : false  
> > > > > }  
> > > > > }  
> > > > > }, {  
> > > > > "or" : {  
> > > > > "filters" : [ {  
> > > > > "term" : {  
> > > > > "metadata.state" : "published"  
> > > > > }  
> > > > > } ]  
> > > > > }  
> > > > > }, {  
> > > > > "and" : {  
> > > > > "filters" : [ {  
> > > > > "term" : {  
> > > > > "metadata.name" : "call of duty"  
> > > > > }  
> > > > > } ]  
> > > > > }  
> > > > > } ]  
> > > > > }  
> > > > > },  
> > > > > "fields" : ,  
> > > > > "sort" : [ {  
> > > > > "metadata.publishDate" : {  
> > > > > "order" : "desc"  
> > > > > }  
> > > > > } ]  
> > > > > }
> 
> > > > > This query returns Zero hits. At the same time, when I submit this  
> > > > > query (via HTTP GET on port 9200) on the \_search endpoint of that  
> > > > > index, I get results as expected.
> 
> > > > > This is happening when any of the values have spaces in them (please  
> > > > > note metadata.name as "call of duty"). If the values do not have  
> > > > > spaces, the queries sent through the TCP Connection work just as good  
> > > > > as them over HTTP.
> 
> > > > > This has put us in a fix - should we send all queries over HTTP and  
> > > > > then parse the results (much cumbersome), or is there something we are  
> > > > > missing while we are sending this query through the Java Driver as
> 
> > > > > ```
> > > > > val result = query.execute.actionGet()
> > > > > 
> > > > > ```
> 
> > > > > Please let me know. I'd appreciate any hints or pointers.
> 
> > > > > -cheers,  
> > > > > Manish
> 
> > > Hi Shay - Thanks for your reply
> 
> > > Exactly! I am building the query using the SearchBuilder - like this:
> 
> > > val query = new  
> > > SearchRequestBuilder(cf.elasticClient).setQuery(matchAllQuery()).
> 
> > > setFrom(startIndex).setSize(count).setNoFields().setIndices(cf.searchConfig uration.indexName).  
> > > setTypes(cf.searchConfiguration.videoModel).addSort(sort,  
> > > if (sortOrder == "desc") SortOrder.DESC else SortOrder.ASC)  
> > > query.setFilter(superFilter)
> 
> > > Where I am adding more filters (as you can see from the output). At  
> > > the end I log the query variable, which renders the JSON that I pasted  
> > > above.
> 
> > > Next I do this :
> 
> > > ```
> > > val result = query.execute.actionGet()
> > > 
> > > ```
> 
> > > Which returns me no results. However, when I paste the JSON produced  
> > > as the value of query, (on the server:9200/index/type/\_search) I am  
> > > able to see the results. This is only happening when any of the values  
> > > contains a space. If there are no spaces, it works great via the Java  
> > > driver as well as HTTP.
> 
> > > Now I am trying to use Apache Commons HTTP Client to send the same  
> > > JSON over HTTP, but the client libraries do not support sending a body  
> > > with GET request. Sending the same on POST does not work obviously.  
> > > Next attempt would be to use Java's HttpURLConnection and hopefully  
> > > that'd let me send a payload over GET but if that too doesn't work, I  
> > > really am out of options ☹
> 
> Hi Shay - Let me take another look at what is going on with my Java  
> Client. I'll probably put a test code with mapping file etc. on my  
> private repo on github and give you access to it if that helps.
> 
> Thanks again - We plan to put Elastic in Production as early as next  
> month, and except for this everything else has been sailing super  
> smooth 🙂
> 
> -cheers,  
> Manish

Hi Shay - My bad. I had the date format wrong, and should have been  
using wildcardQuery. This is resolved now - thanks so much for your  
replies.

-cheers,  
Manish

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:50am UTC](https://discuss.elastic.co/t/inconsistent-results-with-spaced-values-over-tcp-vs-http/5683/7 "2017-07-06T03:50:44Z")

</div>

Closed on July 6, 2017, 3:50am UTC


