Files
wecom_it_smart_desk/scripts/debug/debug_cypher.py
T

27 lines
771 B
Python

import asyncio
import sys
sys.path.insert(0, '/app')
async def test():
from app.services.neo4j_client import get_neo4j_client
neo4j_client = await get_neo4j_client()
keyword = "打印机驱动安装"
# 直接测试 Cypher 查询
try:
data = await neo4j_client.execute_read_query(
"MATCH (i:Issue) WHERE i.name CONTAINS $keyword RETURN i.uuid AS uuid, i.name AS name, i.category AS category LIMIT 5",
{"keyword": keyword}
)
print(f"Data type: {type(data)}")
print(f"Data: {data}")
if data:
print(f"First record uuid: {data[0].get('uuid')}")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
asyncio.run(test())