def load_fixtures(self, file_name): filepath = self.get_fixture_path(file_name) load_fixtures(db, loaders.load(filepath)) db.session.commit() for doc in Document.all(): process_document(doc) self.update_index()
def after(self, result): from aleph.logic.documents import process_document result.update() db.session.commit() document = result.document log.debug('Ingested [%s]: %s', document.id, document.title) process_document(document)
def load_fixtures(self, file_name, process_documents=True): filepath = self.get_fixture_path(file_name) load_fixtures(db, loaders.load(filepath)) db.session.commit() update_collections() if process_documents: for doc in Document.all(): process_document(doc) self.flush_index()