I'm looking for something similar to the MySQL ( SHOW INDEXES ). I was able to get a list of indexes using py2neo in Python
graphDB = neo4j.GraphDatabaseService()
indexes = graphDB.get_indexes(neo4j.Node)
print(format(indexes))
but I wanted to know if there's a way to do something similar in Cypher.
Not yet. In Neo4j 2.0 more cypher friendly indexing was introduced and you can issue some DDL commands to create and drop indices and constraints, but as of 2.01 that's it (see docs). In 1.9 you can't define that type of schema with cypher at all.
--
There are many ways outside of cypher, for instance
In neo4j-shell
you can
index --indexes
schema
schema ls -l :YourLabel
In neo4j-browser
you can
:schema
:schema ls -l :YourLabel
Most APIs that let you execute cypher queries will also provide ways to query schema, such as
GraphDatabaseService.schema().getConstraints()
and .getIndexes()
for label schemaGraphDatabaseService.index().nodeIndexNames()
and .relationshipIndexNames()
for legacy indices/db/data/schema/
endpoints for label based schema/db/data/index/node/
and /db/data/index/relationship/
for legacy indices