Greetings,
I would like to find all documents that have fun = status.loadavg AND item = 15-min
My documents looks like this:
"hits": {
"total": 1050,
"max_score": null,
"hits": [
{
"_index": "warden",
"_type": "default",
"_id": "HZb7gGUBOo9PSxkGKb7n",
"_score": null,
"_source": {
"comment": "0.06",
"fun_args": [],
"jid": "20180828174108532779",
"retcode": 0,
"success": true,
"@timestamp": "2018-08-28T14:41:08.580140+00:00",
"item": "15-min",
"result": 0,
"fun": "status.loadavg"
},
"sort": [
1535467268580
]
},
{
"_index": "warden",
"_type": "default",
"_id": "Hpb7gGUBOo9PSxkGKr4J",
"_score": null,
"_source": {
"comment": "0.09",
"fun_args": [],
"jid": "20180828174108532779",
"retcode": 0,
"success": true,
"@timestamp": "2018-08-28T14:41:08.613462+00:00",
"item": "5-min",
"result": 0,
"fun": "status.loadavg"
},
"sort": [
1535467268613
]
},
{
"_index": "warden",
"_type": "default",
"_id": "H5b7gGUBOo9PSxkGKr4W",
"_score": null,
"_source": {
"comment": "0.14",
"fun_args": [],
"jid": "20180828174108532779",
"retcode": 0,
"success": true,
"@timestamp": "2018-08-28T14:41:08.626802+00:00",
"item": "1-min",
"result": 0,
"fun": "status.loadavg"
},
"sort": [
1535467268626
]
},
Currently I have:
http://localhost:9200/warden/_search/?size=200&sort=@timestamp
{
"query": {
"bool": {
"must": [
{
"term": {
"fun": "status.loadavg"
}
},
{
"term": {
"item": "5-min"
}
}
]
}
}
}
The problem is that I have '-' in my item query and elasticsearch is performing analysis on it. How can I make elasticsearch read this field as it is - raw string?
Btw.
Elasticsearch version 6.3.2