# No results with term filter/query on unanalyzed field

**URL:** <https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256>\
**Category:** Elasticsearch\
**Created:** [May 25, 2015, 1:23pm UTC](https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256 "2015-05-25T13:23:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasco](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@Vasco](https://discuss.elastic.co/u/Vasco)\
**Post date:** [May 25, 2015, 1:23pm UTC](https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256/1 "2015-05-25T13:23:20Z")

</div>

I have a non-analyzed field in my index. The field in question has mapping:

```auto
"ean" : { "index" : "not_analyzed", "type" : "string" }

```

I verified the mappig is working, i.e., the field isn't analyzed.

The record that is not being returned can be found by searching on another field. It seems that the value of the problematic field also isn't included in \_all.

The query I issue is simple:

```auto
{'query': {'term': {'ean': '3660619000159'}}}

```

A filter like so:

```auto
{
  "query": {
    "filtered": {
      "filter": {
        "term": {
          "ean": "3660619000159"
        }
      },
      "query": {
        "match_all": {}
      }
    }
  }
}

```

Also doesn't retrieve anything. Am I missing something obvious? What can cause this behavior? How can I debug this?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [May 25, 2015, 1:42pm UTC](https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256/2 "2015-05-25T13:42:26Z")

</div>

Can you provide a full reproduction of the issue? Also which version of elasticsearch are you running and does your `ean` field happen to be mapped on other types as well?

---

<div class="post-metadata">

**Author:** ![Vasco](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@Vasco](https://discuss.elastic.co/u/Vasco)\
**Post date:** [May 25, 2015, 1:56pm UTC](https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256/3 "2015-05-25T13:56:59Z")

</div>

The inserted documents are the results of a web crawl. I can't reproduce the indexing sequence.

I am running ES 1.5.2

the mapping definition of the index is simple, mostly simple fields:

```auto
{ 
    "properties" : {
        "site" : { "index" : "not_analyzed", 
                     "type" : "string", 
                     "include_in_all": False },
        "ean" : { "index" : "not_analyzed", "type" : "string" },
        <...> more simple fields like ean <...>
    },
    "dynamic_templates": [
        { "data" : {
            "path_match" : "data*",
            "mapping": {
                "index" : "no",
                "store" : "no"
            }
        }}
    ]
}

```

---

<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, 12:12am UTC](https://discuss.elastic.co/t/no-results-with-term-filter-query-on-unanalyzed-field/1256/4 "2017-07-06T00:12:06Z")

</div>


