Check if a given index exists in the Neo4j database.
(driver, index_name: str)
| 138 | |
| 139 | ## checks if an index exists in the neo4j graph |
| 140 | def index_exists(driver, index_name: str) -> bool: |
| 141 | """Check if a given index exists in the Neo4j database.""" |
| 142 | query = f""" |
| 143 | SHOW INDEXES |
| 144 | YIELD name |
| 145 | WHERE name = '{index_name}' |
| 146 | RETURN name |
| 147 | """ |
| 148 | with driver.session() as session: |
| 149 | result = session.run(query).single() |
| 150 | return bool(result) |
| 151 | |
| 152 | ## Sets up the graph database index |
| 153 | def setup_graph_db(driver, index_name, node_label="Child", property_name="embedding"): |
nothing calls this directly
no outgoing calls
no test coverage detected