customize JSON serialization for elasticsearch