# Some help understanding results

**URL:** <https://discuss.elastic.co/t/some-help-understanding-results/3916>\
**Category:** Elasticsearch\
**Created:** [February 11, 2011, 11:57pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916 "2011-02-11T23:57:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sky\_Stebnicki1](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Sky\_Stebnicki1](https://discuss.elastic.co/u/Sky_Stebnicki1)\
**Post date:** [February 11, 2011, 11:57pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/1 "2011-02-11T23:57:07Z")

</div>

Hi all, I am continuing to test ElasticSearch for use with one of our  
applications and generally love what I see.

I ran into some interesting results that I'm struggling to understand.  
If anyone could show me where I've made a mistake please let me know:

I have indexed 1 type : customer { owner\_id=-1, id:3062,  
f\_deleted:false } (there any many other fields but these are what we  
are querying

Anyway, if I run this:

curl -XGET [http://localhost:9200/test/customer/\_search?q=owner\_id:"-1"+f\_deleted:false](http://localhost:9200/test/customer/_search?q=owner_id:%22-1%22+f_deleted:false)

I get 1 result as expected. However if I run:

curl -XGET [http://localhost:9200/ant\_demo/customer/\_search](http://localhost:9200/ant_demo/customer/_search) -d '  
{ "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
"-1""}},"constant\_score":{"filter":{"term":  
{"f\_deleted":"false"}}}}}}}  
'

I get 0 results. To me these should be the exact same query. What am I  
missing?

Thanks so much!

Sky

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 12, 2011, 12:15pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/2 "2011-02-12T12:15:41Z")

</div>

> curl -XGET [http://localhost:9200/ant\_demo/customer/\_search](http://localhost:9200/ant_demo/customer/_search) -d '  
> { "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
> "-1""}},"constant\_score":{"filter":{"term":  
> {"f\_deleted":"false"}}}}}}}  
> '

What happens if you try {"f\_deleted": false } instead of  
{"f\_deleted":"false"} ?

Not sure if that is the issue, but worth a try

clint

---

<div class="post-metadata">

**Author:** ![Sky\_Stebnicki1](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Sky\_Stebnicki1](https://discuss.elastic.co/u/Sky_Stebnicki1)\
**Post date:** [February 12, 2011, 3:18pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/3 "2011-02-12T15:18:47Z")

</div>

I got "f\_deleted":false and "owner\_id":-1 rather than quotes around  
the -1 and got the same results: 0 with the filtered query

Sky

On Feb 12, 4:15 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> > curl -XGEThttp://localhost:9200/ant\_demo/customer/\_search-d '  
> > { "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
> > "-1""}},"constant\_score":{"filter":{"term":  
> > {"f\_deleted":"false"}}}}}}}  
> > '
> 
> What happens if you try {"f\_deleted": false } instead of  
> {"f\_deleted":"false"} ?
> 
> Not sure if that is the issue, but worth a try
> 
> clint

---

<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:** [February 12, 2011, 3:32pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/4 "2011-02-12T15:32:21Z")

</div>

I think your query is malformed. Can you gist a simple curl recreation that index a simple doc, refresh the index, and then execute the query that works, and the one that doesn't? We can then easily run it locally and fix the query if needed.  
On Saturday, February 12, 2011 at 5:18 PM, SkyStebnicki wrote:

> I got "f\_deleted":false and "owner\_id":-1 rather than quotes around  
> the -1 and got the same results: 0 with the filtered query
> 
> Sky
> 
> On Feb 12, 4:15 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:
> 
> > > curl -XGEThttp://localhost:9200/ant\_demo/customer/\_search-d '  
> > > { "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
> > > "-1""}},"constant\_score":{"filter":{"term":  
> > > {"f\_deleted":"false"}}}}}}}  
> > > '
> > 
> > What happens if you try {"f\_deleted": false } instead of  
> > {"f\_deleted":"false"} ?
> > 
> > Not sure if that is the issue, but worth a try
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Sky\_Stebnicki1](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Sky\_Stebnicki1](https://discuss.elastic.co/u/Sky_Stebnicki1)\
**Post date:** [February 13, 2011, 3:23pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/5 "2011-02-13T15:23:39Z")

</div>

Sure, no problem. One quick question, I've never used gist before for  
anything other than viewing source. Where should I go to do that.  
Sorry for the trouble.

Sky

On Feb 12, 7:32 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> I think your query is malformed. Can you gist a simple curl recreation that index a simple doc, refresh the index, and then execute the query that works, and the one that doesn't? We can then easily run it locally and fix the query if needed.
> 
> On Saturday, February 12, 2011 at 5:18 PM, SkyStebnicki wrote:
> 
> > I got "f\_deleted":false and "owner\_id":-1 rather than quotes around  
> > the -1 and got the same results: 0 with the filtered query
> 
> > Sky
> 
> > On Feb 12, 4:15 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:
> > 
> > > > curl -XGEThttp://localhost:9200/ant\_demo/customer/\_search-d'  
> > > > { "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
> > > > "-1""}},"constant\_score":{"filter":{"term":  
> > > > {"f\_deleted":"false"}}}}}}}  
> > > > '
> 
> > > What happens if you try {"f\_deleted": false } instead of  
> > > {"f\_deleted":"false"} ?
> 
> > > Not sure if that is the issue, but worth a try
> 
> > > clint

---

<div class="post-metadata">

**Author:** ![danoyoung](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danoyoung](https://discuss.elastic.co/u/danoyoung)\
**Post date:** [February 13, 2011, 6:12pm UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/6 "2011-02-13T18:12:15Z")

</div>

[https://gist.github.com/](https://gist.github.com/)

Here's some additional pointers/info:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Regards,

Dan

On Sun, Feb 13, 2011 at 8:23 AM, SkyStebnicki [sky.stebnicki@gmail.com](mailto:sky.stebnicki@gmail.com)wrote:

> Sure, no problem. One quick question, I've never used gist before for  
> anything other than viewing source. Where should I go to do that.  
> Sorry for the trouble.
> 
> Sky
> 
> On Feb 12, 7:32 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > I think your query is malformed. Can you gist a simple curl recreation  
> > that index a simple doc, refresh the index, and then execute the query that  
> > works, and the one that doesn't? We can then easily run it locally and fix  
> > the query if needed.
> > 
> > On Saturday, February 12, 2011 at 5:18 PM, SkyStebnicki wrote:
> > 
> > > I got "f\_deleted":false and "owner\_id":-1 rather than quotes around  
> > > the -1 and got the same results: 0 with the filtered query
> > 
> > > Sky
> > 
> > > On Feb 12, 4:15 am, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:
> > > 
> > > > > curl -XGEThttp://localhost:9200/ant\_demo/customer/\_search-d'  
> > > > > { "query":{"filtered":{"query":{"query\_string":{"query":"owner\_id:  
> > > > > "-1""}},"constant\_score":{"filter":{"term":  
> > > > > {"f\_deleted":"false"}}}}}}}  
> > > > > '
> > 
> > > > What happens if you try {"f\_deleted": false } instead of  
> > > > {"f\_deleted":"false"} ?
> > 
> > > > Not sure if that is the issue, but worth a try
> > 
> > > > clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 14, 2011, 11:06am UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/7 "2011-02-14T11:06:28Z")

</div>

On Sun, 2011-02-13 at 07:23 -0800, SkyStebnicki wrote:

> Sure, no problem. One quick question, I've never used gist before for  
> anything other than viewing source. Where should I go to do that.  
> Sorry for the trouble.

Hi Sky

Have a look at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help) - it'll tell you all  
you need to know about gisting a curl recreation (and if it doesn't, let  
me know what is missing so that I can improve it)

thanks

clint

---

<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:12am UTC](https://discuss.elastic.co/t/some-help-understanding-results/3916/8 "2017-07-06T04:12:07Z")

</div>


