Add document index serialization for elasticsearch