tomer
(tomer zaks)
September 19, 2017, 6:14am
1
Hi,
I am having a problem getting decimal numbers in the ES
as shown below:
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?
tomer
(tomer zaks)
September 19, 2017, 6:41am
3
Hi,
Yes, I tried
Also in the visualization, it shows as if there is only 0 or 1
What is the mapping for that field?
tomer
(tomer zaks)
September 19, 2017, 7:25am
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"
},
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
system
(system)
Closed
October 17, 2017, 8:13am
8
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.