# Doc\['field\_name'\] returns unexpected big number

**URL:** <https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525>\
**Category:** Elasticsearch\
**Created:** [September 1, 2016, 9:56am UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525 "2016-09-01T09:56:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhmtnlr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhmtnlr/32/45665_2.png) [@mhmtnlr](https://discuss.elastic.co/u/mhmtnlr)\
**Post date:** [September 1, 2016, 9:56am UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525/1 "2016-09-01T09:56:41Z")

</div>

Hey guys,  
I am using ES 1.7. I run following query and i expect to get 1 which is current popularity for it. but it returns 4607464916994563600.

```
POST /myIndex/en/_search
{
  "size": 1,
  "script_fields": {
    "toTestField": {
      "script": "doc['popularity'].value"
    }
  }
}

```

Result:

```
{
  "took": 87,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "hits": {
    "total": 3059534,
    "max_score": 1,
    "hits": [
      {
        "_index": "myIndex",
        "_type": "en",
        "_id": "12345",
        "_score": 1,
        "fields": {
          "toTestField": [
            4607464916994563600
          ]
        }
      }
    ]
  }
}

```

Any ideas, why this happen?

---

<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:** [September 1, 2016, 2:05pm UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525/2 "2016-09-01T14:05:12Z")

</div>

Could you please also post a minimal set of indexing requests so following your search snippets becomes easier?

Thanks,  
Isabel

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [September 1, 2016, 2:22pm UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525/3 "2016-09-01T14:22:32Z")

</div>

You might be hitting the problem described in this post: [Sum Aggregation returning very small, unrelated values](https://discuss.elastic.co/t/sum-aggregation-returning-very-small-unrelated-values/26890/3)

Upgrading to 2.4 and reindexing should solve the issue. If you aren't able to upgrade to 2.4 then re-indexing with a defined mapping and not relying on dynamic mapping should help avoid this issue

---

<div class="post-metadata">

**Author:** ![mhmtnlr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhmtnlr/32/45665_2.png) [@mhmtnlr](https://discuss.elastic.co/u/mhmtnlr)\
**Post date:** [September 2, 2016, 11:59am UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525/4 "2016-09-02T11:59:12Z")

</div>

Yes, apparently this was ES 1.7 bug. I couldn't upgrade ES right now. I just disable the dynamic mapping and reindex all data. Until upgrade it should be fine

---

<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, 10:22pm UTC](https://discuss.elastic.co/t/doc-field-name-returns-unexpected-big-number/59525/5 "2017-07-05T22:22:53Z")

</div>


