Skip to content

Instantly share code, notes, and snippets.

@coolgarifTech
Created May 17, 2013 16:54
Show Gist options
  • Save coolgarifTech/5600426 to your computer and use it in GitHub Desktop.
Save coolgarifTech/5600426 to your computer and use it in GitHub Desktop.
Creating an index using python embedded bindings in Neo4j
with db.transaction:
# Create an index for nodes & relations
COMPANY_NAME_INDEX = "COMPANY_NAME_INDEX"
if db.node.indexes.exists(COMPANY_NAME_INDEX) == 0:
companyNameIndex = db.node.indexes.create(COMPANY_NAME_INDEX)
else:
companyNameIndex = db.node.indexes.get(COMPANY_NAME_INDEX)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment