Add write stream functionality to indexer