Can't push decimal numbers

Hi,
I am having a problem getting decimal numbers in the ES

as shown below:

image

I have an "ASR" that is 0.9, but when I use the following query:
GET filebeat-*/log/_search
{
"query": {

   "bool":{ 

      "must": [
        { "match": { "ASR": "0.9"}}
        
        ]
  
     
   }
  }
}

I get:

> {
>   "took": 1,
>   "timed_out": false,
>   "_shards": {
>     "total": 2,
>     "successful": 2,
>     "failed": 0
>   },
>   "hits": {
>     "total": 0,
>     "max_score": null,
>     "hits": []
>   }
> } 

The log its self is as following:

"{"eventTimestamp":1505760179999,"asrFrom":1505759776499,"ASR":0.9}"

Help will be great I am gravely under pressure on this subject.

Did you try to remove the qoutes?

Hi,
Yes, I tried :frowning:
Also in the visualization, it shows as if there is only 0 or 1

What is the mapping for that field?

I actually solved this by pushing in percentage instead of decimal such as instead of .5 => 50, but I am still interested why is this happening, so here is my mapping:

"ASR": {
"type": "long"
},

Sorry, i'm not used to mapping.
I just always index the data directly

In order to store floats, you need to map the field as float or double instead of long. This will require reindexing.

1 Like

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