<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def charge_documents(self):
 """ This method allow you to charge documents you already have in your database. In this way an Index would be created according to the model and fields registered. """


    doc_count   = self._whoosh.doc_count()
    objs        = orm.count(e for e in self._model)

    field_names = set(self._schema_attrs.keys())
    missings    = set(self._whoosh.schema.names())

    for f in list(field_names - missings):
        self.add_field(f, fields.TEXT(self.kw))

    if doc_count == 0 and objs > 0:
      writer = self._whoosh.writer()
      for obj in orm.select(e for e in self._model):
        attrs = {self._primary_key: obj.get_pk()}
        for f in list(self._schema_attrs.keys()):
          attrs[f] = str(getattr(obj, f))
        writer.add_document(**attrs)
      writer.commit()