I'm using the AWS ElasticSearch service (1.5.2) and is receiving more than 100 requests/sec without problems.
Almost every query have geo filters, full text filters, integer filters... But I have a problem, adding one simple filter more; a boolean term filter.
{
"from" : 0,
"size" : 10,
"query" : {
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
"and" : {
"filters" : [ {
"bool" : {
"must" : [ {
"terms" : {
"my_boolean_field" : [ false ]
}
},
{
"range" : {
"_timestamp" : {
"from" : null,
"to" : "2016-05-04T15:12:00Z",
"include_lower" : true,
"include_upper" : false
}
}
} ]
}
}, {
"geo_distance" : {
"rounded_location" : [ -8.42, 42.24 ],
"distance" : "300000m",
"distance_type" : "plane",
"optimize_bbox" : "indexed"
}
} ]
}
}
}
},
"sort" : [ {
"_geo_distance" : {
"rounded_location" : [ {
"lat" : 42.24,
"lon" : -8.42
} ],
"unit" : "m"
}
}, {
"date" : {
"order" : "desc"
}
}, {
"price" : {
"order" : "asc"
}
} ]
}
Once the boolean filter is added, CPU in all nodes of ElasticSearch increases from 10 to 30% and during 10-15 minutes the average latency increases from 20 to 400ms, after a while latencies go back to normal numbers but CPU doesn't.
That boolean field is mapped properly and is searchable... has anyone a hint about this issue? (Query is formed with "terms" instead of "term" due to the official Java library that I'm using).