mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 08:26:05 +08:00
let index be batchly. (#733)
### What problem does this PR solve? let index be batchly. ### Type of change - [x] Refactoring
This commit is contained in:
parent
04a9e95161
commit
ffe5737f7d
@ -285,7 +285,12 @@ def main():
|
|||||||
init_kb(r)
|
init_kb(r)
|
||||||
chunk_count = len(set([c["_id"] for c in cks]))
|
chunk_count = len(set([c["_id"] for c in cks]))
|
||||||
st = timer()
|
st = timer()
|
||||||
es_r = ELASTICSEARCH.bulk(cks, search.index_name(r["tenant_id"]))
|
es_r = ""
|
||||||
|
for b in range(0, len(cks), 32):
|
||||||
|
es_r = ELASTICSEARCH.bulk(cks[b:b+32], search.index_name(r["tenant_id"]))
|
||||||
|
if b % 128 == 0:
|
||||||
|
callback(prog=0.8 + 0.1 * (b + 1) / len(cks), msg="")
|
||||||
|
|
||||||
cron_logger.info("Indexing elapsed({}): {}".format(r["name"], timer()-st))
|
cron_logger.info("Indexing elapsed({}): {}".format(r["name"], timer()-st))
|
||||||
if es_r:
|
if es_r:
|
||||||
callback(-1, "Index failure!")
|
callback(-1, "Index failure!")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user