Add serialization for indexing