I have almost 10K of scripts like this:
POST _scripts/536672d3cface3ddbb63666bf1b6030f
{
"script": {
"lang": "painless",
"source": "Pattern p = /\\s?a\\S*?/i; p.matcher(params._source.summary ?: '').find();"
}
}
Query:
{
"query": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"query_string": {
"query": "a*",
"quote_analyzer": "standard",
"allow_leading_wildcard": "true",
"analyze_wildcard": "true",
"default_operator": "AND",
"phrase_slop": 1
}
},
{
"script": {
"script": {
"id": "536672d3cface3ddbb63666bf1b6030f"
}
}
}
]
}
}
]
}
}
}
everything stored in a percolator, when it is getting percolated I am getting [script] Too many dynamic script compilations within one minute, max: [15/min]
.
I have changed from 15 to 5000, of course our executions are more than 500 / minutes and failing.
In anyway we can handle this error
Or or requirement is support wildcards like our users will search for aus* gov*
, aus* poli* blah*
or any combination of wildcard with multiple words.
other than scripting any other way to support wildcard search?
Tried with ngrams and edge-ngrams, but it is not the perfect match and ended in script, but it is failing here.
Script with parameter won't work with Pattern
otherwise I could have used parameterized scripts!