# Float value is matched as integer

**URL:** <https://discuss.elastic.co/t/float-value-is-matched-as-integer/279406>\
**Category:** Elasticsearch\
**Created:** [July 22, 2021, 3:22pm UTC](https://discuss.elastic.co/t/float-value-is-matched-as-integer/279406 "2021-07-22T15:22:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leuteris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leuteris/32/89009_2.png) [@Leuteris](https://discuss.elastic.co/u/Leuteris)\
**Post date:** [July 22, 2021, 3:22pm UTC](https://discuss.elastic.co/t/float-value-is-matched-as-integer/279406/1 "2021-07-22T15:22:07Z")

</div>

I've indexed the following document:

```auto
  {
                "_index": "index_name",
                "_type": "_doc",
                "_id": "ePvEB-X7TNSfKMdwxOcGTw",
                "_score": 1.0,
                "_source": {
                    "jWVuCKvK": 6.65678676226262E13,
                }
 }

```

with the corresponding mapping:

```auto
   "properties": {
                "jWVuCKvK": {
                    "type": "float"
                }
            }

```

Field `jWVuCKvK` has the floating point value: 66567867622626.2

The numbers 66567867622626, 66567867622626.545644 or 66567867622626.5 match this number. Sample search request:

POST /\_search

```auto
{
   "size":1,
   "terminate_after":30001,
   "query":{
      "bool":{
         "filter":[
            {
               "term":{
                  "jWVuCKvK":{
                     "value":66567867622626,
                     "boost":1.0
                  }
               }
            }
         ],
         "adjust_pure_negative":true,
         "boost":1.0
      }
   },
   "sort":[
      {
         "_shard_doc":{
            "order":"asc"
         }
      }
   ],
   "track_total_hits":-1,
   "pit":{
      "id":"n5qzAwEMdXNlcl9wcm9maWxlFklOZ1VWWUlWUi0yU2hpMS1TUlJ3dlEAFnJQZ3lVTU9DUzR1VXkzbU5EalBJWFEAAAAAAAAAAg0WVkRTeUY5X0JTcWFnVm11a290eXQ1UQABFklOZ1VWWUlWUi0yU2hpMS1TUlJ3dlEAAA==",
      "keep_alive":"10m"
   }
}

```

I would expect it to match only for value 66567867622626.2. How could I achieve this? Please note that i am using dynamic mapping.

---

<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:** [August 19, 2021, 3:22pm UTC](https://discuss.elastic.co/t/float-value-is-matched-as-integer/279406/2 "2021-08-19T15:22:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
