# Pulling values for properties that have index set to "no"

**URL:** <https://discuss.elastic.co/t/pulling-values-for-properties-that-have-index-set-to-no/61106>\
**Category:** Elasticsearch\
**Created:** [September 21, 2016, 10:40am UTC](https://discuss.elastic.co/t/pulling-values-for-properties-that-have-index-set-to-no/61106 "2016-09-21T10:40:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [September 21, 2016, 11:16am UTC](https://discuss.elastic.co/t/pulling-values-for-properties-that-have-index-set-to-no/61106/2 "2016-09-21T11:16:47Z")

</div>

Hi,

good question, as you said you can't retrieve the fields with the document Get API or by searching. But refering to the blog post you mentioned, the fields that are later used in aggregations are declared as having `"doc_values": true` in the mappings. This means that for those fields the data is stored on disk using the [doc\_values](https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html) data structure which is optimized for use in aggregations but cannot be searched.

You can still take a look at those values using [fielddata\_fields](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-fielddata-fields.html) functionality. Here is a small example:

```auto
PUT /test
{
  "mappings": {
    "type": {
      "_all": { "enabled": false },
      "_source": { "enabled": false },
      "properties": {
        "count": {
           "type": "integer", "doc_values": true, "index": "no" }
        
      }
    }
  }
}

PUT /test/type/1
{
  "count" : 5,
  "age": 21
}

PUT /test/type/2
{
  "count" : 10,
  "age" : 13
}

GET /test/type/1

GET /test/type/_search
{
  "query": {
    "ids": {
      "values" : ["1"]
    }
  },
  "fielddata_fields": ["count"]
}

```

With the above mapping, searching for "count" e.g. with a range query will give you a exception because the field is not indexed. However, using the "ids" query to filter one (or more) documents, you can see the field data (or in this case doc\_values) of that field.

---

_[View the full topic](https://discuss.elastic.co/t/pulling-values-for-properties-that-have-index-set-to-no/61106)._
