def get_bulk(self, create=False):
result = []<EOL>op_type = "<STR_LIT:index>"<EOL>if create:<EOL><INDENT>op_type = "<STR_LIT>"<EOL><DEDENT>meta = self._meta<EOL>cmd = {op_type: {"<STR_LIT>": meta.index, "<STR_LIT>": meta.type}}<EOL>if meta.parent:<EOL><INDENT>cmd[op_type]['<STR_LIT>'] = meta.parent<EOL><DEDENT>if meta.version:<EOL><INDENT>cmd[op_type]['<STR_LIT>'] = meta.version<EOL><DEDENT>if meta.id:<EOL><INDENT>cmd[op_type]['<STR_LIT>'] = meta.id<EOL><DEDENT>result.append(json.dumps(cmd, cls=self._meta.connection.encoder))<EOL>result.append("<STR_LIT:\n>")<EOL>result.append(json.dumps(self, cls=self._meta.connection.encoder))<EOL>result.append("<STR_LIT:\n>")<EOL>return '<STR_LIT>'.join(result)<EOL>
Return bulk code