def get_doc_info(result):
    """Get the index, doc_type, and id associated with a document.

    Parameters
    ----------
    result : dict
        A document from an Elasticsearch search result.

    Returns
    -------
    dict
        A dictionary with keys 'index', 'doc_type', and 'id',
        containing the name of the index in which the document resides,
        the doc_type of the document, and its id.

    """
    return {
        'index': result['_index'],
        'doc_type': result['_type'],
        'id': result['_id']
    }