# Basic Query Syntax

**URL:** <https://discuss.elastic.co/t/basic-query-syntax/3792>\
**Category:** Elasticsearch\
**Created:** [January 17, 2011, 4:50pm UTC](https://discuss.elastic.co/t/basic-query-syntax/3792 "2011-01-17T16:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katrina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katrina/32/3288_2.png) [@Katrina](https://discuss.elastic.co/u/Katrina)\
**Post date:** [January 17, 2011, 4:50pm UTC](https://discuss.elastic.co/t/basic-query-syntax/3792/1 "2011-01-17T16:50:36Z")

</div>

Hi there,

I can't seem to figure out where I've gone wrong with the query DSL.

When working against the Rest API I get results with this:

curl -XGET [http://127.0.0.1:9200/myindex/mytype/\_search?q=user:annie](http://127.0.0.1:9200/myindex/mytype/_search?q=user:annie)

however I get zero results back when I make the call like this:

curl -XGET [http://127.0.0.1:9200/myindex/mytype/\_search](http://127.0.0.1:9200/myindex/mytype/_search) -d '  
{  
"query" : {  
"term" : { "user" : "annie" }  
}  
}  
'

=\> {"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
0,"max\_score":null,"hits":[]}}

Can any of you see what I've missed here?

Cheers,  
Katrina

---

<div class="post-metadata">

**Author:** ![Katrina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katrina/32/3288_2.png) [@Katrina](https://discuss.elastic.co/u/Katrina)\
**Post date:** [January 17, 2011, 5:10pm UTC](https://discuss.elastic.co/t/basic-query-syntax/3792/2 "2011-01-17T17:10:23Z")

</div>

Ah jeez-- I had a casing issue!

My document is indexed with user 'Annie', and I was actually making  
the query with the capitalized name.

curl -XGET [http://127.0.0.1:9200/myindex/mytype/\_search](http://127.0.0.1:9200/myindex/mytype/_search) -d '  
{  
"query" : {  
"term" : { "user" : "Annie" }  
}  
}

'

When I lowercase the user name, it comes back with the expected  
results.

Sorry about that!

---

<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:13am UTC](https://discuss.elastic.co/t/basic-query-syntax/3792/3 "2017-07-06T04:13:44Z")

</div>


