@Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeSharedString(type);
   out.writeOptionalString(id);
   out.writeOptionalString(routing);
   out.writeOptionalString(parent);
   out.writeOptionalString(timestamp);
   out.writeLong(ttl);
   out.writeBytesReference(source);
   out.writeByte(opType.id());
   out.writeBoolean(refresh);
   out.writeLong(version);
   out.writeByte(versionType.getValue());
 }
    @Override
    public void writeTo(StreamOutput out) throws IOException {
      out.writeSharedString(index);
      out.writeOptionalSharedString(type);
      out.writeString(id);
      out.writeOptionalString(routing);
      if (fields == null) {
        out.writeVInt(0);
      } else {
        out.writeVInt(fields.length);
        for (String field : fields) {
          out.writeString(field);
        }
      }

      Versions.writeVersionWithVLongForBW(version, out);
      out.writeByte(versionType.getValue());

      FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
    }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeVLong(interval);
   out.writeSharedString(preTz.getID());
   out.writeSharedString(postTz.getID());
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeByte(unit.id());
   out.writeSharedString(preTz.getID());
   out.writeSharedString(postTz.getID());
 }