Files
wecom_it_smart_desk/scripts/debug/debug_neo4j.py
T

28 lines
845 B
Python

import asyncio
import sys
sys.path.insert(0, '/app')
async def test():
from app.services.graph_query_service import get_graph_query_service
from app.services.neo4j_client import get_neo4j_client
import logging
logging.basicConfig(level=logging.DEBUG)
neo4j_client = await get_neo4j_client()
graph_service = await get_graph_query_service(neo4j_client)
keyword = "打印机驱动安装"
print(f"Querying keyword: {keyword}")
# 直接调用 Neo4j 查询
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"Raw data: {data}")
except Exception as e:
print(f"Error: {e}")
asyncio.run(test())