<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_doc_to_update(self, action, update_spec, action_buffer_index):
 """ Prepare document for update based on Elasticsearch response. Set flag if document needs to be retrieved from Elasticsearch """


        doc = {
            "_index": action["_index"],
            "_type": action["_type"],
            "_id": action["_id"],
        }

        # If get_from_ES == True -> get document's source from Elasticsearch
        get_from_ES = self.should_get_id(action)
        self.doc_to_update.append((doc, update_spec, action_buffer_index, get_from_ES))