# Can't search on specific field

**URL:** <https://discuss.elastic.co/t/cant-search-on-specific-field/27353>\
**Category:** Elasticsearch\
**Created:** [August 13, 2015, 10:58pm UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353 "2015-08-13T22:58:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nomlaran](https://avatars.discourse-cdn.com/v4/letter/n/b19c9b/32.png) [@nomlaran](https://discuss.elastic.co/u/nomlaran)\
**Post date:** [August 13, 2015, 10:58pm UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353/1 "2015-08-13T22:58:03Z")

</div>

I'm unable to retrieve results using a filter on the field called "series":

This search returns 92 results:

```
GET /foos/Thing/_search
{
  "query": {
    "filtered": {
      "query": {
        "term": {
          "entityId": {
            "value": "105595155"
          }
        }
      }, 
      "filter": {
        "exists": {
          "field": "series"
        }
      }
    }
  }
}

```

The documents look like this:

```
{
        "_index": "foos",
        "_type": "Thing",
        "_id": "AU8pQXuqCDS84EhJEeld",
        "_score": 9.216088,
        "_source": {
           "metadata": {},
           "lastTimestamp": "2015-04-01T19:49:07.000Z",
           "series": "foo",
           "lastNormalizedTimestamp": "2015-04-01T19:49:07.000Z",
           "normalizedTimestamp": "2015-04-01T19:49:07.000Z",
           "entityId": "105595155",
           "value": 8,
           "timestamp": "2015-04-01T19:49:07.000Z"
        }
     },

```

This search, however, returns 0 results:

```
GET /foos/Thing/_search
{
  "query": {
    "filtered": {
      "query": {
        "term": {
          "entityId": {
            "value": "105595155"
          }
        }
      }, 
      "filter": {
        "term": {
          "series": "foo"
        }
      }
    }
  }
}

```

For the life of me, I haven't figured out why I can't retrieve results with a specific value in the "series" field.

Do you know why?

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [August 13, 2015, 11:36pm UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353/2 "2015-08-13T23:36:47Z")

</div>

Can you provide your mapping for /foo/Thing.

---

<div class="post-metadata">

**Author:** ![nomlaran](https://avatars.discourse-cdn.com/v4/letter/n/b19c9b/32.png) [@nomlaran](https://discuss.elastic.co/u/nomlaran)\
**Post date:** [August 13, 2015, 11:39pm UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353/3 "2015-08-13T23:39:00Z")

</div>

GET /foo/\_mapping/Thing

```
{
   "foo": {
      "mappings": {
         "Thing": {
            "properties": {
               "entityId": {
                  "type": "string",
                  "store": true
               },
               "lastNormalizedTimestamp": {
                  "type": "date",
                  "store": true,
                  "format": "dateOptionalTime"
               },
               "lastTimestamp": {
                  "type": "date",
                  "store": true,
                  "format": "dateOptionalTime"
               },
               "metadata": {
                  "type": "object"
               },
               "normalizedTimestamp": {
                  "type": "date",
                  "store": true,
                  "format": "dateOptionalTime"
               },
               "series": {
                  "type": "string",
                  "store": true
               },
               "timestamp": {
                  "type": "date",
                  "store": true,
                  "format": "dateOptionalTime"
               },
               "value": {
                  "type": "double",
                  "store": true
               }
            }
         }
      }
   }
}
```

---

<div class="post-metadata">

**Author:** ![remram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remram/32/4077_2.png) [@remram](https://discuss.elastic.co/u/remram)\
**Post date:** [August 14, 2015, 9:07am UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353/4 "2015-08-14T09:07:48Z")

</div>

Try to change the mapping for that field to:

```
...
    "series": {
        "type": "string",
        "store": true,
        "index": "not_analyzed"
    }
...
```

---

<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:55pm UTC](https://discuss.elastic.co/t/cant-search-on-specific-field/27353/5 "2017-07-05T23:55:50Z")

</div>


