Pregunta

I am using py2neo to upload the initial data into neo4j and am using batches to make it faster. I was wondering if there is a way to create indexes too using batches.

Thanks

¿Fue útil?

Solución

I found a good solution for this. The WriteBatch() has the method add_index_node eg,

batch = neo4j.WriteBatch(graph_db)  
a = batch.create(node(name='Alice'))  
batch.add_index_node("people","name","alice",a)  
batch.submit()
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top