def _simplify_doc(doc):
<EOL>doc = dict(doc)<EOL>if '<STR_LIT:text>' not in doc:<EOL><INDENT>raise ValueError("<STR_LIT>".format(doc))<EOL><DEDENT>return {<EOL>'<STR_LIT:text>': doc['<STR_LIT:text>'],<EOL>'<STR_LIT>': doc.get('<STR_LIT>', []),<EOL>'<STR_LIT:title>': doc.get('<STR_LIT:title>', '<STR_LIT>')<EOL>}<EOL>
Limit a document to just the three fields we should upload.