Hi,
I'm trying to execute a rather complicated nested bool query:
((string match and range) OR (string match and range)) AND((string match and range) OR (string match and range)) AND ...
and I see that the range query has a tremendous effect on performance (~400ms per range).
Been making an effort to run this under nested filter but haven't been able to build a valid query.
Currently the query looks like this:
{
"size": 0,
"query": {
"bool": {
"must": [
{
"nested": {
"path": "obj1",
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"match": {
"var": "example4"
}
},
{
"range": {
"absolutePvs": {
"gte": 1
}
}
}
]
}
},
{
"bool": {
"must": [
{
"match": {
"var": "example3"
}
},
{
"range": {
"absolutePvs": {
"gte": 1
}
}
}
]
}
}
]
}
}
}
},
{
"nested": {
"path": "obj2",
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"match": {
"var": "example1"
}
},
{
"range": {
"absolutePvs": {
"gte": 1
}
}
}
]
}
},
{
"bool": {
"must": [
{
"match": {
"var": "example2"
}
},
{
"range": {
"absolutePvs": {
"gte": 1
}
}
}
]
}
}
]
}
}
}
}
]
}
}
}
currently this query takes ~3 seconds to run. When removing the range conditions, the query runs
in ~300ms.
Does anyone know how can I improve this???
Thanks in advanced,
Oren