I have some question about using scripted field with painless, so i have some set of data that look like this,
One Document can only contain identifier (MWStart or MWEnd), and i want to get like:
if the identifier is MWStart then find the reqtxnid that the identifier is MWEnd. so how can i do dis?
and i have tried this script:
string reqTXNID = doc['reqtxnid.keyword'].value;
string idf = doc['identifier.keyword'].value;if(idf == 'MWStart') {
for(int i=0; i<params._source.reqtxnid.length; i++) {
if(params._source.reqtxnid[i] == reqTXNID && params._source.identifier[i] == "MWEnd"){
return 1;
break;
}
else { return 0;}
}
}
else {return null;}
then i got this error:
Discover: compile 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] setting
i hope someone can help me
, thanks


