code: def add_to_sources(self, action, doc_source):
          
          mapping = self.sources.setdefault(action["_index"], {}).setdefault(
              action["_type"], {}
          )
          mapping[action["_id"]] = doc_source
docs: Store sources locally