FiltersFunctionScoreQuery.FilterFunction[] filterFunctions = new FiltersFunctionScoreQuery.FilterFunction[filters.size()];
for (int i = 0; i < filterFunctions.length; i++) {
ScoreFunction scoreFunction;
String script = scripts.get(i);
if (script != null) {
SearchScript searchScript = context.scriptService().search(context.lookup(), scriptLang, script, vars);
scoreFunction = new CustomScoreQueryParser.ScriptScoreFunction(searchScript);
} else {
scoreFunction = new BoostScoreFunction(boosts.get(i));
}
filterFunctions[i] = new FiltersFunctionScoreQuery.FilterFunction(filters.get(i), scoreFunction);