[fix] Create a complete index

This commit is contained in:
lanceyq
2026-03-30 16:07:15 +08:00
parent 8b44b2cd61
commit e15af5a2ba
2 changed files with 2 additions and 14 deletions

View File

@@ -151,9 +151,9 @@ async def write(
# Step 3: Save all data to Neo4j database
step_start = time.time()
from app.repositories.neo4j.create_indexes import create_fulltext_indexes
from app.repositories.neo4j.create_indexes import create_all_indexes
try:
await create_fulltext_indexes()
await create_all_indexes()
except Exception as e:
logger.error(f"Error creating indexes: {e}", exc_info=True)

View File

@@ -144,18 +144,6 @@ async def create_vector_indexes():
""")
print("✓ Created: dialogue_embedding_index")
# Community summary embedding index
await connector.execute_query("""
CREATE VECTOR INDEX community_summary_embedding_index IF NOT EXISTS
FOR (c:Community)
ON c.summary_embedding
OPTIONS {indexConfig: {
`vector.dimensions`: 1024,
`vector.similarity_function`: 'cosine'
}}
""")
print("✓ Created: community_summary_embedding_index")
print("\nVector indexes created successfully!")
print("\nExpected performance improvement:")
print(" Before: ~1.4s for embedding search")