From 14a6e2423bee0edbbc2f620ecc7d90727e6186aa Mon Sep 17 00:00:00 2001 From: voje Date: Sun, 28 Apr 2019 23:24:40 +0200 Subject: [PATCH] logging when indexing --- src/backend_flask/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend_flask/app.py b/src/backend_flask/app.py index b4bcae8..3f27281 100644 --- a/src/backend_flask/app.py +++ b/src/backend_flask/app.py @@ -453,6 +453,9 @@ def prepare_app_index(appindex_json): for corpus in CORPORA: res_hws = {} res_fns = {} + + nentries = valdb[corpus].count() + idx = 0 for e in valdb[corpus].find({}): if "headwords" not in e: continue @@ -468,6 +471,10 @@ def prepare_app_index(appindex_json): res_fns[fn] += 1 else: res_fns[fn] = 1 + idx += 1 + if idx % 10000 == 0: + log.debug("indexing {}: {}/{}".format( + corpus, idx, nentries)) alphabetical = {} for k, e in res_hws.items():