Hi,
I am doing a migration from Elasticsearch 2.3 to elasticesearch 6.2. The index migration was done successfully but i am facing a performance issue after the migration in Bounding box/polygon queries when used with terms query.
Bellow are my findings:
Elasticsearch instance Info:
{
"capture_index_2" : {
"settings" : {
"index" : {
"number_of_shards" : "5",
"blocks" : {
"write" : "false"
},
"provided_name" : "capture_index_2",
"max_result_window" : "50000",
"creation_date" : "1526027809998",
"number_of_replicas" : "1",
"uuid" : "Rlj8kwCoTReI6vfhjH9YeQ",
"version" : {
"created" : "6020299"
}
}
}
}
}
Document Count : 240445029
Size in bytes : 53.59 GB
My Query :
{
"query": {
"bool": {
"filter": [
{
"bool": {
"must": [
{
"geo_bounding_box": {
"alignedlocation": {
"bottom_left": {
"lat": 32.77086742341999,
"lon": -96.79832736358046
},
"top_right": {
"lat": 32.7731293740476,
"lon": -96.77691577468067
}
}
}
},
{
"terms": {
"vehicleType": [
0,
1
]
}
},
{
"terms": {
"dataformat": [
0,
1
]
}
}
],
"should": [
{
"range": {
"expirationdate": {
"gt": "1526668200000"
}
}
},
{
"range": {
"datatypes": {
"gte": "0",
"lt": "2"
}
}
},
{
"range": {
"datatypes": {
"gt": "4"
}
}
}
],
"minimum_should_match": 1
}
}
]
}
},
"from": 0,
"size": 1000,
"sort": [
{
"starttime": {
"order": "desc"
}
},
{
"uuid": {
"order": "desc"
}
},
{
"eventid": {
"order": "asc"
}
}
]
}
and in ES 2.3 this query takes 39 ms where in ES 6.2 it takes 370 ms and one interesting fact is if i remove the termsQueries from the ES 6.2 query the time reduce to 22 ms.
Requesting for assistance.