{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "a*",
"quote_analyzer": "standard",
"allow_leading_wildcard": "true",
"analyze_wildcard": "true",
"default_operator": "AND",
"phrase_slop": 1
}
},
{
"script": {
"script": {
"source": "Pattern p = /\\s?a\\S*?/i; p.matcher(params._source.summary ?: '').find();",
"lang": "painless"
}
}
}
]
}
}
}
I want the above query to parameterize because sometimes I am getting an error
[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute]
If we go for index script or file-based script will it help to remove this error?