We have a 4 node cluster. Searching On a index with 40k records is taking upto 3 secs. It used to take less than a second like 400ms but now in last couple of weeks, it started slowing down. We dont see much of GC in the logs
We are on ES 1.4.2. 2 Nodes are allocated 31 Gb of 64 GB heap and other 2 nodes are allocated 15GB of 32 GB heap
us_zip_codes/_search
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"script": {
"script": "doc['zip_code'].values.findIndexOf{ srcVal -> param1.any{ it =~ /^(?i).*\\Q${srcVal}\\E.*/}} !=-1",
"lang": "groovy",
"params": {
"param1": [
"94555-2750"
]
}
}
}
}
}
}
us_zip_codes has 5 digit zip_codes and we want to find a match when have a 9 digit code. I am using above script. How do i troubleshot this issue?
Also, is there a better way to re-write that query. Any help is greatly appreciated