fix: add text_doc flag
This commit is contained in:
parent
ff263c0132
commit
c5f0c4af87
1 changed files with 3 additions and 6 deletions
|
|
@ -67,12 +67,9 @@ async def update_node_access_timestamps(items: List[Any]):
|
||||||
# Step 2: Find origin TextDocument nodes (without hardcoded relationship names)
|
# Step 2: Find origin TextDocument nodes (without hardcoded relationship names)
|
||||||
origin_query = """
|
origin_query = """
|
||||||
UNWIND $node_ids AS node_id
|
UNWIND $node_ids AS node_id
|
||||||
MATCH (n:Node {id: node_id})
|
MATCH (chunk:Node {id: node_id})-[e:EDGE]-(doc:Node)
|
||||||
OPTIONAL MATCH (n)-[e:EDGE]-(chunk:Node)
|
WHERE chunk.type = 'DocumentChunk' AND doc.type IN ['TextDocument', 'Document']
|
||||||
WHERE chunk.type = 'DocumentChunk'
|
RETURN DISTINCT doc.id
|
||||||
OPTIONAL MATCH (chunk)-[e2:EDGE]-(doc:Node)
|
|
||||||
WHERE doc.type IN ['TextDocument', 'PdfDocument', 'AudioDocument', 'ImageDocument', 'UnstructuredDocument']
|
|
||||||
RETURN DISTINCT doc.id as doc_id
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
result = await graph_engine.query(origin_query, {"node_ids": node_ids})
|
result = await graph_engine.query(origin_query, {"node_ids": node_ids})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue