# Simple Search trouble

**URL:** <https://discuss.elastic.co/t/simple-search-trouble/37205>\
**Category:** Elasticsearch\
**Created:** [December 15, 2015, 8:19am UTC](https://discuss.elastic.co/t/simple-search-trouble/37205 "2015-12-15T08:19:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![living\_jordi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/living_jordi/32/61363_2.png) [@living\_jordi](https://discuss.elastic.co/u/living_jordi)\
**Post date:** [December 15, 2015, 8:19am UTC](https://discuss.elastic.co/t/simple-search-trouble/37205/1 "2015-12-15T08:19:38Z")

</div>

I'm using elasticsearch 2.1. I'm not quite figuring out what I'm doing wrong. It baffles me the differents between queries, filters... Could you help me please?

I'm trying to perform this query. It returns me an empty result:

```
curl -XGET 'http://ESNode01:9201/living_team/inputs/_search?pretty' -d '
{
    "query": {
        "filtered": { 
            "query": { "match_all": {} },
            "filter": { "term": { "channel": "Feina" } }
        }
     }
}
'

```

However, when I perform this query without filters it returns me everything:

```
curl -XGET 'http://ESNode01:9201/living_team/inputs/_search?pretty' -d '
{
    "query": {
        "filtered": { 
            "query": { "match_all": {} },
        }
     }
}
'

```

This is a document sample:

```
{
  "user":"living_team",
  "timestamp":"2015-12-14T18:06:47.085Z",
  "matter":"snip2.PNG",
  "comment":"Archive",
  "channel":"Feina",
  "feedTypes":[
     20
  ],
  "property_general_ldate":"2015-12-14T18:06:47.085Z",
  "property_tSize":7595.0,
  "resources":[
     {
        "timestamp":"2015-12-14T16:58:00.598Z",
        "matter":"snip2.PNG",
        "comment":"Archive",
        "channel":"Feina",
        "feedType":20,
        "mime":"image/png",
        "source":{
           "sourceId":{
              "id":"C:\\Users\\Beep\\Desktop\\share\\snip2.PNG",
              "batch":"c38eec2d-a282-11e5-baf4-382c4ab9e433",
              "client":"VIM12HCNZL"
           },
           "feedType":20,
           "property_folder":"C:\\Users\\Beep\\Desktop\\share",
           "property_lastAccessFolder_ldate":1450111821506
        },
        "property_size":7595.0,
        "property_creation_ldate":"2015-12-14T16:50:20.578Z",
        "property_name":"snip2.PNG",
        "nestedResources":[

        ]
     }
  ]
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 15, 2015, 8:48am UTC](https://discuss.elastic.co/t/simple-search-trouble/37205/2 "2015-12-15T08:48:24Z")

</div>

Try with `feina` instead of `Feina`

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [December 15, 2015, 8:59am UTC](https://discuss.elastic.co/t/simple-search-trouble/37205/3 "2015-12-15T08:59:44Z")

</div>

To add a bit more background: "The term query finds documents that contain the exact term specified in the inverted index. [...] String fields can be analyzed (treated as full text, like the body of an email), or not\_analyzed (treated as exact values, like an email address or a zip code). Exact values (like numbers, dates, and not\_analyzed strings) have the exact value specified in the field added to the inverted index in order to make them searchable."

If you want to understand how TermQuery and MatchQuery differ, see also here where the quote above is taken from:

[https://www.elastic.co/guide/en/elasticsearch/reference/2.1/query-dsl-term-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/query-dsl-term-query.html)

Hope this helps,  
Isabel

---

<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 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/simple-search-trouble/37205/4 "2017-07-05T23:31:01Z")

</div>


