static List<Entry<String, RequestInfo>> initScriptMatchAllSearchRequests(String script, boolean langNative) {
List<Entry<String, RequestInfo>> nativeSearchRequests = new ArrayList<>();
String infoString = "Results for constant score script:";
ScriptScoreFunctionBuilder scriptFunction = (langNative == true) ? scriptFunction(script, "native") : scriptFunction(script);
SearchRequest request = searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().explain(false).size(0)
.query(functionScoreQuery(FilterBuilders.matchAllFilter(), scriptFunction).boostMode(CombineFunction.REPLACE)));
nativeSearchRequests.add(new AbstractMap.SimpleEntry<>(infoString, new RequestInfo(request, 0)));
return nativeSearchRequests;