def METHOD_NAME(self, env: BuildEnvironment, docname: str, document: Node) -> None:
    """Process a document after it is read by the environment."""
    entries = self.entries.setdefault(env.docname, [])
    for node in list(document.findall(addnodes.index)):
        try:
            for (entry_type, value, _target_id, _main, _category_key) in node['entries']:
                split_index_msg(entry_type, value)
        except ValueError as exc:
            logger.warning(str(exc), location=node)
            node.parent.remove(node)
        else:
            for entry in node['entries']:
                entries.append(entry)