Can't push decimal numbers


(tomer zaks) #1

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.


(Jonar B) #2

Did you try to remove the qoutes?


(tomer zaks) #3

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


(Christian Dahlqvist) #4

What is the mapping for that field?


(tomer zaks) #5

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"
},


(Jonar B) #6

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


(Christian Dahlqvist) #7

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


(system) #8

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