# Weird difference in total results when executing directly against REST or through Java API

**URL:** <https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127>\
**Category:** Elasticsearch\
**Created:** [March 18, 2011, 12:16pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127 "2011-03-18T12:16:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [March 18, 2011, 12:16pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/1 "2011-03-18T12:16:33Z")

</div>

Hi,

I just noticed I have a weird difference in the number of results depending  
on whether I execute my query as a direct REST (with curl) or via JAVA API.

So for instance, if I use the REST call:

{  
"from": 0,  
"size": 30,  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "_iphone_",  
"default\_operator": "and",  
"analyze\_wildcard": true  
}  
},  
"filter": {  
"and": {  
"filters": [  
{  
"range": {  
"cantidad": {  
"from": 6.35,  
"to": 527.12,  
"include\_lower": true,  
"include\_upper": true  
}  
}  
},  
{  
"term": {  
"categorias1": "Electrónica"  
}  
}  
]  
}  
}  
}  
},  
"explain": false,  
"sort": [  
{  
"\_score": {}  
}  
]  
}

then I get these results:

{

- took: 552
- timed\_out: false
- \_shards: {
  - total: 3
  - successful: 3
  - failed: 0  
}

- hits: {
  - total: 578
  - max\_score: 1
  - hits: [
    - {
      - \_index: cuestamenos
      - \_type: producto
      - \_id: XqvBlh3JSxy9WBgXRfbNLQ
      - \_score: 1
      - \_source: {
        - nombre: Altec Lansing T612 Altavoz para iPhone/iPod
        - 

.....  
.....  
.....  
.....

As you can see, 578 results.

But when I use the JAVA API (and I make sure it's exactly the same query  
because I print the generated JSON out in the logs and it matches exactly):

```
*def* response = search.execute().actionGet()

```

_def_ result = [:]

result.query = querystring

result.hits = response?.hits()

result.total = result?.hits?.totalHits()

LOG.debug "Search returned ${result.total ?: 0} result(s)."

then it says:

2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil - Search  
returned 576 result(s).

And doing some more tests, it turns out that the JAVA API always displays  
exactly 2 less than the REST approach.

Any clue why the JAVA API call returns always exactly 2 results less than  
the REST call?

I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT

Thanks.

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [March 18, 2011, 12:25pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/2 "2011-03-18T12:25:15Z")

</div>

Just thinking loud, but could it be that ES is not picking up the inclusive  
range in the JAVA API, hence discarding the first and last match in the  
price range?

```
          "range": {
            "cantidad": {
              "from": 6.35,
              "to": 527.12,
              "include_lower": true,
              "include_upper": true
            }
          }

```

On Fri, Mar 18, 2011 at 1:16 PM, Enrique Medina Montenegro \<  
[e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:

> Hi,
> 
> I just noticed I have a weird difference in the number of results depending  
> on whether I execute my query as a direct REST (with curl) or via JAVA API.
> 
> So for instance, if I use the REST call:
> 
> {  
> "from": 0,  
> "size": 30,  
> "query": {  
> "filtered": {  
> "query": {  
> "query\_string": {  
> "query": "_iphone_",  
> "default\_operator": "and",  
> "analyze\_wildcard": true  
> }  
> },  
> "filter": {  
> "and": {  
> "filters": [  
> {  
> "range": {  
> "cantidad": {  
> "from": 6.35,  
> "to": 527.12,  
> "include\_lower": true,  
> "include\_upper": true  
> }  
> }  
> },  
> {  
> "term": {  
> "categorias1": "Electrónica"  
> }  
> }  
> ]  
> }  
> }  
> }  
> },  
> "explain": false,  
> "sort": [  
> {  
> "\_score": {}  
> }  
> ]  
> }
> 
> then I get these results:
> 
> {
> 
> - took: 552
> - timed\_out: false
> - \_shards: {
> - total: 3
> - successful: 3
> - failed: 0  
> }
> 
> - hits: {
> - total: 578
> - max\_score: 1
> - hits: [
> - {
> - \_index: cuestamenos
> - \_type: producto
> - \_id: XqvBlh3JSxy9WBgXRfbNLQ
> - \_score: 1
> - \_source: {
> - nombre: Altec Lansing T612 Altavoz para iPhone/iPod
> - 
> 
> .....  
> .....  
> .....  
> .....
> 
> As you can see, 578 results.
> 
> But when I use the JAVA API (and I make sure it's exactly the same query  
> because I print the generated JSON out in the logs and it matches exactly):
> 
> _def_ response = search.execute().actionGet()
> 
> _def_ result = [:]
> 
> result.query = querystring
> 
> result.hits = response?.hits()
> 
> result.total = result?.hits?.totalHits()
> 
> LOG.debug "Search returned ${result.total ?: 0} result(s)."
> 
> then it says:
> 
> 2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil -  
> Search returned 576 result(s).
> 
> And doing some more tests, it turns out that the JAVA API always displays  
> exactly 2 less than the REST approach.
> 
> Any clue why the JAVA API call returns always exactly 2 results less than  
> the REST call?
> 
> I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT
> 
> Thanks.

---

<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:** [March 18, 2011, 12:34pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/3 "2011-03-18T12:34:55Z")

</div>

Can you post how you build the query using the Java API?  
On Friday, March 18, 2011 at 2:25 PM, Enrique Medina Montenegro wrote:

> Just thinking loud, but could it be that ES is not picking up the inclusive range in the JAVA API, hence discarding the first and last match in the price range?
> 
> "range": {  
> "cantidad": {  
> "from": 6.35,  
> "to": 527.12,  
> "include\_lower": true,  
> "include\_upper": true  
> }  
> }
> 
> On Fri, Mar 18, 2011 at 1:16 PM, Enrique Medina Montenegro [e.medina.m@gmail.com](mailto:e.medina.m@gmail.com) wrote:
> 
> > Hi,
> > 
> > I just noticed I have a weird difference in the number of results depending on whether I execute my query as a direct REST (with curl) or via JAVA API.
> > 
> > So for instance, if I use the REST call:
> > 
> > {  
> > "from": 0,  
> > "size": 30,  
> > "query": {  
> > "filtered": {  
> > "query": {  
> > "query\_string": {  
> > "query": "_iphone_",  
> > "default\_operator": "and",  
> > "analyze\_wildcard": true  
> > }  
> > },  
> > "filter": {  
> > "and": {  
> > "filters": [  
> > {  
> > "range": {  
> > "cantidad": {  
> > "from": 6.35,  
> > "to": 527.12,  
> > "include\_lower": true,  
> > "include\_upper": true  
> > }  
> > }  
> > },  
> > {  
> > "term": {  
> > "categorias1": "ElectrÃ³nica"  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > }  
> > },  
> > "explain": false,  
> > "sort": [  
> > {  
> > "\_score": {}  
> > }  
> > ]  
> > }
> > 
> > then I get these results:
> > 
> > {  
> > took: 552  
> > timed\_out: false  
> > \_shards: {  
> > total: 3  
> > successful: 3  
> > failed: 0
> > 
> > }  
> > hits: {  
> > total: 578  
> > max\_score: 1  
> > hits: [  
> > {  
> > \_index: cuestamenos  
> > \_type: producto  
> > \_id: XqvBlh3JSxy9WBgXRfbNLQ  
> > \_score: 1  
> > \_source: {  
> > nombre: Altec Lansing T612 Altavoz para iPhone/iPod
> > 
> > .....  
> > .....  
> > .....  
> > .....
> > 
> > As you can see, 578 results.
> > 
> > But when I use the JAVA API (and I make sure it's exactly the same query because I print the generated JSON out in the logs and it matches exactly):
> > 
> > def response = search.execute().actionGet()
> > 
> > def result = [:]  
> > result.query = querystring  
> > result.hits = response?.hits()  
> > result.total = result?.hits?.totalHits()
> > 
> > LOG.debug "Search returned ${result.total ?: 0} result(s)."
> > 
> > then it says:
> > 
> > 2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil - Search returned 576 result(s).
> > 
> > And doing some more tests, it turns out that the JAVA API always displays exactly 2 less than the REST approach.
> > 
> > Any clue why the JAVA API call returns always exactly 2 results less than the REST call?
> > 
> > I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT
> > 
> > Thanks.

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [March 18, 2011, 12:41pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/4 "2011-03-18T12:41:49Z")

</div>

Shay,

I was doing some more research, and I noticed that I was using a  
rangeFilter(), and then I changed it to numericRangeFilter(), but with the  
same result ☹

```
numericRangeFilter("cantidad").from(searchParams.cantidad.selected)

```

.to(searchParams.cantidad._to_)

.includeLower(_true_).includeUpper(_true_)

Regards.

On Fri, Mar 18, 2011 at 1:34 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Can you post how you build the query using the Java API?
> 
> On Friday, March 18, 2011 at 2:25 PM, Enrique Medina Montenegro wrote:
> 
> Just thinking loud, but could it be that ES is not picking up the inclusive  
> range in the JAVA API, hence discarding the first and last match in the  
> price range?
> 
> ```
> "range": {
> "cantidad": {
> "from": 6.35,
> "to": 527.12,
> "include_lower": true,
> "include_upper": true
> }
> }
> 
> ```
> 
> On Fri, Mar 18, 2011 at 1:16 PM, Enrique Medina Montenegro \<  
> [e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:
> 
> Hi,
> 
> I just noticed I have a weird difference in the number of results depending  
> on whether I execute my query as a direct REST (with curl) or via JAVA API.
> 
> So for instance, if I use the REST call:
> 
> {  
> "from": 0,  
> "size": 30,  
> "query": {  
> "filtered": {  
> "query": {  
> "query\_string": {  
> "query": "_iphone_",  
> "default\_operator": "and",  
> "analyze\_wildcard": true  
> }  
> },  
> "filter": {  
> "and": {  
> "filters": [  
> {  
> "range": {  
> "cantidad": {  
> "from": 6.35,  
> "to": 527.12,  
> "include\_lower": true,  
> "include\_upper": true  
> }  
> }  
> },  
> {  
> "term": {  
> "categorias1": "Electrónica"  
> }  
> }  
> ]  
> }  
> }  
> }  
> },  
> "explain": false,  
> "sort": [  
> {  
> "\_score": {}  
> }  
> ]  
> }
> 
> then I get these results:
> 
> {
> 
> - took: 552
> - timed\_out: false
> - \_shards: {
> - total: 3
> - successful: 3
> - failed: 0  
> }
> 
> - hits: {
> - total: 578
> - max\_score: 1
> - hits: [
> - {
> - \_index: cuestamenos
> - \_type: producto
> - \_id: XqvBlh3JSxy9WBgXRfbNLQ
> - \_score: 1
> - \_source: {
> - nombre: Altec Lansing T612 Altavoz para iPhone/iPod
> - 
> 
> .....  
> .....  
> .....  
> .....
> 
> As you can see, 578 results.
> 
> But when I use the JAVA API (and I make sure it's exactly the same query  
> because I print the generated JSON out in the logs and it matches exactly):
> 
> _def_ response = search.execute().actionGet()
> 
> _def_ result = [:]
> 
> result.query = querystring
> 
> result.hits = response?.hits()
> 
> result.total = result?.hits?.totalHits()
> 
> LOG.debug "Search returned ${result.total ?: 0} result(s)."
> 
> then it says:
> 
> 2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil -  
> Search returned 576 result(s).
> 
> And doing some more tests, it turns out that the JAVA API always displays  
> exactly 2 less than the REST approach.
> 
> Any clue why the JAVA API call returns always exactly 2 results less than  
> the REST call?
> 
> I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT
> 
> Thanks.

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [March 18, 2011, 12:42pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/5 "2011-03-18T12:42:21Z")

</div>

Forgot to mention that both values are JAVA Float values...

On Fri, Mar 18, 2011 at 1:41 PM, Enrique Medina Montenegro \<  
[e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:

> Shay,
> 
> I was doing some more research, and I noticed that I was using a  
> rangeFilter(), and then I changed it to numericRangeFilter(), but with the  
> same result ☹
> 
> numericRangeFilter("cantidad").from(searchParams.cantidad.selected)
> 
> .to(searchParams.cantidad._to_)
> 
> .includeLower(_true_).includeUpper(_true_)
> 
> Regards.
> 
> On Fri, Mar 18, 2011 at 1:34 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Can you post how you build the query using the Java API?
> > 
> > On Friday, March 18, 2011 at 2:25 PM, Enrique Medina Montenegro wrote:
> > 
> > Just thinking loud, but could it be that ES is not picking up the  
> > inclusive range in the JAVA API, hence discarding the first and last match  
> > in the price range?
> > 
> > ```
> > "range": {
> > "cantidad": {
> > "from": 6.35,
> > "to": 527.12,
> > "include_lower": true,
> > "include_upper": true
> > }
> > }
> > 
> > ```
> > 
> > On Fri, Mar 18, 2011 at 1:16 PM, Enrique Medina Montenegro \<  
> > [e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:
> > 
> > Hi,
> > 
> > I just noticed I have a weird difference in the number of results  
> > depending on whether I execute my query as a direct REST (with curl) or via  
> > JAVA API.
> > 
> > So for instance, if I use the REST call:
> > 
> > {  
> > "from": 0,  
> > "size": 30,  
> > "query": {  
> > "filtered": {  
> > "query": {  
> > "query\_string": {  
> > "query": "_iphone_",  
> > "default\_operator": "and",  
> > "analyze\_wildcard": true  
> > }  
> > },  
> > "filter": {  
> > "and": {  
> > "filters": [  
> > {  
> > "range": {  
> > "cantidad": {  
> > "from": 6.35,  
> > "to": 527.12,  
> > "include\_lower": true,  
> > "include\_upper": true  
> > }  
> > }  
> > },  
> > {  
> > "term": {  
> > "categorias1": "Electrónica"  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > }  
> > },  
> > "explain": false,  
> > "sort": [  
> > {  
> > "\_score": {}  
> > }  
> > ]  
> > }
> > 
> > then I get these results:
> > 
> > {
> > 
> > - took: 552
> > - timed\_out: false
> > - \_shards: {
> > - total: 3
> > - successful: 3
> > - failed: 0  
> > }
> > 
> > - hits: {
> > - total: 578
> > - max\_score: 1
> > - hits: [
> > - {
> > - \_index: cuestamenos
> > - \_type: producto
> > - \_id: XqvBlh3JSxy9WBgXRfbNLQ
> > - \_score: 1
> > - \_source: {
> > - nombre: Altec Lansing T612 Altavoz para iPhone/iPod
> > - 
> > 
> > .....  
> > .....  
> > .....  
> > .....
> > 
> > As you can see, 578 results.
> > 
> > But when I use the JAVA API (and I make sure it's exactly the same query  
> > because I print the generated JSON out in the logs and it matches exactly):
> > 
> > _def_ response = search.execute().actionGet()
> > 
> > _def_ result = [:]
> > 
> > result.query = querystring
> > 
> > result.hits = response?.hits()
> > 
> > result.total = result?.hits?.totalHits()
> > 
> > LOG.debug "Search returned ${result.total ?: 0} result(s)."
> > 
> > then it says:
> > 
> > 2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil -  
> > Search returned 576 result(s).
> > 
> > And doing some more tests, it turns out that the JAVA API always displays  
> > exactly 2 less than the REST approach.
> > 
> > Any clue why the JAVA API call returns always exactly 2 results less than  
> > the REST call?
> > 
> > I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT
> > 
> > Thanks.

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [March 18, 2011, 12:49pm UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/6 "2011-03-18T12:49:55Z")

</div>

Some more feedback...

If I substract/add 0.001 to each boundary in the range, then it works fine.  
Could it be that using the JAVA API something is being rounded up/down  
somehow?

Example:

[6.35, 527.12] --\> Doesn't work  
[6.351, 527.121] -\> Works

On Fri, Mar 18, 2011 at 1:42 PM, Enrique Medina Montenegro \<  
[e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:

> Forgot to mention that both values are JAVA Float values...
> 
> On Fri, Mar 18, 2011 at 1:41 PM, Enrique Medina Montenegro \<  
> [e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:
> 
> > Shay,
> > 
> > I was doing some more research, and I noticed that I was using a  
> > rangeFilter(), and then I changed it to numericRangeFilter(), but with the  
> > same result ☹
> > 
> > numericRangeFilter("cantidad").from(searchParams.cantidad.selected)
> > 
> > .to(searchParams.cantidad._to_)
> > 
> > .includeLower(_true_).includeUpper(_true_)
> > 
> > Regards.
> > 
> > On Fri, Mar 18, 2011 at 1:34 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Can you post how you build the query using the Java API?
> > > 
> > > On Friday, March 18, 2011 at 2:25 PM, Enrique Medina Montenegro wrote:
> > > 
> > > Just thinking loud, but could it be that ES is not picking up the  
> > > inclusive range in the JAVA API, hence discarding the first and last match  
> > > in the price range?
> > > 
> > > ```
> > > "range": {
> > > "cantidad": {
> > > "from": 6.35,
> > > "to": 527.12,
> > > "include_lower": true,
> > > "include_upper": true
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > On Fri, Mar 18, 2011 at 1:16 PM, Enrique Medina Montenegro \<  
> > > [e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:
> > > 
> > > Hi,
> > > 
> > > I just noticed I have a weird difference in the number of results  
> > > depending on whether I execute my query as a direct REST (with curl) or via  
> > > JAVA API.
> > > 
> > > So for instance, if I use the REST call:
> > > 
> > > {  
> > > "from": 0,  
> > > "size": 30,  
> > > "query": {  
> > > "filtered": {  
> > > "query": {  
> > > "query\_string": {  
> > > "query": "_iphone_",  
> > > "default\_operator": "and",  
> > > "analyze\_wildcard": true  
> > > }  
> > > },  
> > > "filter": {  
> > > "and": {  
> > > "filters": [  
> > > {  
> > > "range": {  
> > > "cantidad": {  
> > > "from": 6.35,  
> > > "to": 527.12,  
> > > "include\_lower": true,  
> > > "include\_upper": true  
> > > }  
> > > }  
> > > },  
> > > {  
> > > "term": {  
> > > "categorias1": "Electrónica"  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > }  
> > > },  
> > > "explain": false,  
> > > "sort": [  
> > > {  
> > > "\_score": {}  
> > > }  
> > > ]  
> > > }
> > > 
> > > then I get these results:
> > > 
> > > {
> > > 
> > > - took: 552
> > > - timed\_out: false
> > > - \_shards: {
> > > - total: 3
> > > - successful: 3
> > > - failed: 0  
> > > }
> > > 
> > > - hits: {
> > > - total: 578
> > > - max\_score: 1
> > > - hits: [
> > > - {
> > > - \_index: cuestamenos
> > > - \_type: producto
> > > - \_id: XqvBlh3JSxy9WBgXRfbNLQ
> > > - \_score: 1
> > > - \_source: {
> > > - nombre: Altec Lansing T612 Altavoz para iPhone/iPod
> > > - 
> > > 
> > > .....  
> > > .....  
> > > .....  
> > > .....
> > > 
> > > As you can see, 578 results.
> > > 
> > > But when I use the JAVA API (and I make sure it's exactly the same query  
> > > because I print the generated JSON out in the logs and it matches exactly):
> > > 
> > > _def_ response = search.execute().actionGet()
> > > 
> > > _def_ result = [:]
> > > 
> > > result.query = querystring
> > > 
> > > result.hits = response?.hits()
> > > 
> > > result.total = result?.hits?.totalHits()
> > > 
> > > LOG.debug "Search returned ${result.total ?: 0} result(s)."
> > > 
> > > then it says:
> > > 
> > > 2011-03-18 13:12:18,228 [http-8080-4] DEBUG util.ElasticSearchUtil -  
> > > Search returned 576 result(s).
> > > 
> > > And doing some more tests, it turns out that the JAVA API always displays  
> > > exactly 2 less than the REST approach.
> > > 
> > > Any clue why the JAVA API call returns always exactly 2 results less than  
> > > the REST call?
> > > 
> > > I'm working with latest from master as of today --\> 0.16.0.SNAPSHOT
> > > 
> > > Thanks.

---

<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, 4:09am UTC](https://discuss.elastic.co/t/weird-difference-in-total-results-when-executing-directly-against-rest-or-through-java-api/4127/7 "2017-07-06T04:09:41Z")

</div>


