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);
}
FiltersFunctionScoreQuery functionScoreQuery = new FiltersFunctionScoreQuery(query, scoreMode, filterFunctions);
functionScoreQuery.setBoost(boost);