mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-20 04:37:09 +02:00
@@ -105,6 +105,7 @@ def document_by_cc_pair_cleanup_task(
|
|||||||
tenant_id=tenant_id,
|
tenant_id=tenant_id,
|
||||||
chunk_count=chunk_count,
|
chunk_count=chunk_count,
|
||||||
)
|
)
|
||||||
|
|
||||||
delete_documents_complete__no_commit(
|
delete_documents_complete__no_commit(
|
||||||
db_session=db_session,
|
db_session=db_session,
|
||||||
document_ids=[document_id],
|
document_ids=[document_id],
|
||||||
|
@@ -61,10 +61,10 @@ def _create_indexable_chunks(
|
|||||||
doc_updated_at=None,
|
doc_updated_at=None,
|
||||||
primary_owners=[],
|
primary_owners=[],
|
||||||
secondary_owners=[],
|
secondary_owners=[],
|
||||||
chunk_count=1,
|
chunk_count=preprocessed_doc["chunk_ind"] + 1,
|
||||||
)
|
)
|
||||||
if preprocessed_doc["chunk_ind"] == 0:
|
|
||||||
ids_to_documents[document.id] = document
|
ids_to_documents[document.id] = document
|
||||||
|
|
||||||
chunk = DocMetadataAwareIndexChunk(
|
chunk = DocMetadataAwareIndexChunk(
|
||||||
chunk_id=preprocessed_doc["chunk_ind"],
|
chunk_id=preprocessed_doc["chunk_ind"],
|
||||||
@@ -92,6 +92,7 @@ def _create_indexable_chunks(
|
|||||||
boost=DEFAULT_BOOST,
|
boost=DEFAULT_BOOST,
|
||||||
large_chunk_id=None,
|
large_chunk_id=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
chunks.append(chunk)
|
chunks.append(chunk)
|
||||||
|
|
||||||
return list(ids_to_documents.values()), chunks
|
return list(ids_to_documents.values()), chunks
|
||||||
@@ -192,6 +193,7 @@ def seed_initial_documents(
|
|||||||
last_successful_index_time=last_index_time,
|
last_successful_index_time=last_index_time,
|
||||||
seeding_flow=True,
|
seeding_flow=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_pair_id = cast(int, result.data)
|
cc_pair_id = cast(int, result.data)
|
||||||
processed_docs = fetch_versioned_implementation(
|
processed_docs = fetch_versioned_implementation(
|
||||||
"onyx.seeding.load_docs",
|
"onyx.seeding.load_docs",
|
||||||
@@ -249,4 +251,5 @@ def seed_initial_documents(
|
|||||||
.values(chunk_count=doc.chunk_count)
|
.values(chunk_count=doc.chunk_count)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
db_session.commit()
|
||||||
kv_store.store(KV_DOCUMENTS_SEEDED_KEY, True)
|
kv_store.store(KV_DOCUMENTS_SEEDED_KEY, True)
|
||||||
|
Reference in New Issue
Block a user