def process_document(document): """Perform post-ingest tasks like analysis and indexing.""" analyze_document(document) index_document(document) index_records(document) if document.collection.casefile: index_collection(document.collection)
def load_fixtures(self, file_name, process_documents=True): filepath = os.path.abspath(os.path.join(FIXTURES, file_name)) load_fixtures(db, loaders.load(filepath)) db.session.commit() if process_documents: for doc_id, in Document.all_ids(): analyze_document(doc_id) optimize_search()
def after(self, result): result.update() db.session.commit() if result.error_message: log.warn('Error [%r]: %s', result, result.error_message) else: log.debug('Ingested: %r', result.document) analyze_document(result.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() if process_documents: for doc_id, in Document.all_ids(): analyze_document(doc_id) optimize_search()
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() reindex_entities() if process_documents: for doc in Document.all(): analyze_document(doc) flush_index()
def emit(self, document): db.session.commit() log.debug("Ingested document: %r", document) analyze_document(document.id)
def process_document(document): """Perform post-ingest tasks like analysis and indexing.""" analyze_document(document) index.index_document(document) index.index_records(document)
def process_document_id(document_id): """Perform post-ingest tasks like analysis and indexing.""" analyze_document(Document.by_id(document_id))
def emit(self, document): db.session.commit() log.debug("Ingested document: %r", document) analyze_document(document)