@Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeString(STREAM.getName());
   out.writeOptionalString(scriptLang);
   out.writeString(scriptString);
   ScriptService.ScriptType.writeTo(scriptType, out);
   out.writeMap(params);
 }
 @Override
 public SignificanceHeuristic readResult(StreamInput in) throws IOException {
   return new ScriptHeuristic(
       null,
       in.readOptionalString(),
       in.readString(),
       ScriptService.ScriptType.readFrom(in),
       in.readMap());
 }