updateRequest.docAsUpsert(request.paramAsBoolean("doc_as_upsert", updateRequest.docAsUpsert()));
ScriptParameterParser scriptParameterParser = new ScriptParameterParser();
scriptParameterParser.parseParams(request);
ScriptParameterValue scriptValue = scriptParameterParser.getDefaultScriptParameterValue();
if (scriptValue != null) {
updateRequest.script(scriptValue.script(), scriptValue.scriptType());
}
String scriptLang = scriptParameterParser.lang();
if (scriptLang != null) {
updateRequest.scriptLang(scriptLang);
}