code: def index(self, *args, **kwargs):
          
          self.check_session()
          result = self.session.index(*args, **kwargs)
          if self.autosession:
              self.commit()
          return result
docs: Index documents, in the current session