import os
from neo4j import GraphDatabase
from dotenv import load_dotenv

load_dotenv()
driver = GraphDatabase.driver(
    os.getenv("NEO4J_URI"),
    auth=(os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD"))
)

indexes = ["background_emb", "methodology_emb", "gap_emb", "objective_emb", "futurework_emb"]

with driver.session() as session:
    for idx in indexes:
        try:
            session.run(f"DROP INDEX {idx}")
            print(f"Dropped {idx}")
        except Exception as e:
            print(f"Failed to drop {idx}: {e}")
            
driver.close()
