Elasticsearch mongoDb River + Native Script Plugin

I am currently trying to run a nativescript with the "script" property of
the river configuration. The script is starting as expected but the problem
is that doc() is always null and I can't access any fields of the document
to run my document transformation.

Any idea how to solve this?
public class LambertToWgs84Script extends AbstractSearchScript {

public static class Factory implements NativeScriptFactory {

public ExecutableScript newScript(@Nullable
                                  Map<String, Object> params) {

  return new LambertToWgs84Script(params);


public Object run() {
// Get xy Values
Long x = (Long) doc().get(
Long y = (Long) doc().get(

// Transformation

// Write Coordinates back
JSONObject newLocation = new JSONObject();
try {
  newLocation.put("Type", "Point");
  JSONArray coords = new JSONArray();
  newLocation.put("coordinates", coords);
  doc().put("location", newLocation);
} catch (JSONException e) {

return true;


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.