Good morning, excuse my English. I am new to elastic and I am doing some tests with the queries, I have the following case:
I have two indeces, metrics and a custom one of my own, I was able to make each one a separate queries that are fired when a record is obtained, now what I want to do is try to join both queries, I tried as follows:
GET _search
{
"size": 1,
"query": {
"bool": {
"must": [
{
"range": {
"apache.status.uptime.uptime": {
"from": 0,
"to": null,
"include_lower": false,
"include_upper": false,
"boost": 1.0
}
}
},
{
"range": {
"@timestamp": {
"gte": "now-20s",
"to": "now",
"include_lower": false,
"include_upper": false,
"time_zone": "Z",
"format": "strict_date_optional_time_nanos",
"boost": 1.0
}
}
},
{
"range": {
"duration": {
"from": 0,
"to": null,
"include_lower": false,
"include_upper": false,
"boost": 1.0
}
}
},
{
"range": {
"start2": {
"gte": "now-30m",
"to": "now",
"include_lower": false,
"include_upper": false,
"boost": 1.0
}
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"_source": false,
"fields": [
{
"field": "apache.status.uptime.uptime"
},
{
"field": "duration"
},
{
"field": "answer2"
},
{
"field": "answer"
}
]
}
I am assuming that it does not bring results when I join them, because it tries to search in the same index all 4 conditions. What I'm trying to do is not possible?
Thanks in advance.