def save(self, bulk=False, id=None, parent=None, routing=None, force=False):
meta = self._meta<EOL>conn = meta['<STR_LIT>']<EOL>id = id or meta.get("<STR_LIT:id>", None)<EOL>parent = parent or meta.get('<STR_LIT>', None)<EOL>routing = routing or meta.get('<STR_LIT>', None)<EOL>qargs = None<EOL>if routing:<EOL><INDENT>qargs={'<STR_LIT>': routing}<EOL><DEDENT>version = meta.get('<STR_LIT:version>', None)<EOL>if force:<EOL><INDENT>version = None<EOL><DEDENT>res = conn.index(self,<EOL>meta.index, meta.type, id, parent=parent, bulk=bulk,<EOL>version=version, force_insert=force,<EOL>querystring_args=qargs)<EOL>if not bulk:<EOL><INDENT>self._meta.id = res._id<EOL>self._meta.version = res._version<EOL>return res._id<EOL><DEDENT>return id<EOL>
Save the object and returns id