@wrap_exceptions<EOL><INDENT>def bulk_upsert(self, docs, namespace, timestamp):<DEDENT>
if self.auto_commit_interval is not None:<EOL><INDENT>add_kwargs = {<EOL>"<STR_LIT>": (self.auto_commit_interval == <NUM_LIT:0>),<EOL>"<STR_LIT>": str(self.auto_commit_interval)<EOL>}<EOL><DEDENT>else:<EOL><INDENT>add_kwargs = {"<STR_LIT>": False}<EOL><DEDENT>cleaned = (self._clean_doc(d, namespace, timestamp) for d in docs)<EOL>if self.chunk_size > <NUM_LIT:0>:<EOL><INDENT>batch = list(next(cleaned) for i in range(self.chunk_size))<EOL>while batch:<EOL><INDENT>self.solr.add(batch, **add_kwargs)<EOL>batch = list(next(cleaned)<EOL>for i in range(self.chunk_size))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.solr.add(cleaned, **add_kwargs)<EOL><DEDENT>
Update or insert multiple documents into Solr

        docs may be any iterable