Query range problem

Dears,

How to modify such query to add additional condition to first range "0nn"?

I need to find only such documents which meet such conditions:
ci.a": { "gte": 0,"lte": 99} and ci.b like "(??1?) or (??3?) or (??5?) or (??7?) or (??9?)"

POST /log-2020-06-29/_search?size=0
{
"query": {
"bool": {
"filter": [
{
"range": {
"@timestamp": {
"gte": "2020-06-29T07:22:01",
"lte": "2020-06-29T11:31:01"
}
}
}
]
}
},
"aggs": {
"mti": {
"filters": {
"filters": {
"0nn" : { "range": {"ci.a": { "gte": 0,"lte": 99}}},
"4nn" : { "range": {"ci.a": { "gte": 400,"lte": 499}}},
"1nn-2nn" : { "range": {"ci.a": { "gte": 100,"lte": 299}}},
"9nn" : { "range": {"ci.a": { "gte": 900,"lte": 999}}}
}
}
}
}
}

Regards,
Daniel

I'm not 100% sure what you are going for, but I'd look at the wildcard query. You might filter on a couple of them.

If you want to group the agg by them you can also do a filters agg.

In my query there is filter for such range:
"0nn" : { "range": {"ci.a": { "gte": 0,"lte": 99}}}

I would like to put to this container less docs which meet additional condition:

          "query_string": {
            "query": "(??1?) or (??3?) or (??5?) or (??7?) or (??9?)",
            "default_field": "ci.b"

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