Reputation: 4392
I have a numeric auto index defined:
val db = new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(dbPath.getAbsolutePath)
.newGraphDatabase()
neo.schema.indexFor(USER_LABEL).on(PROP_CURSOR).create()
I'd like this index to be used for numeric queries (I'm interested in nodes with the lowest "cursor" property). However, I can't find how best to do this in the API documentation. Any suggestions?
I'd prefer to avoid legacy Neo4J indexes as they're cumbersome to maintain, and I couldn't find a way to update a value in a legacy index.
Upvotes: 1
Views: 168
Reputation: 1798
You can use the GraphDatabaseService#findNodesByLabelAndProperty
method (available on your db
val).
There's good documentation example of this here: http://neo4j.com/docs/stable/tutorials-java-embedded-new-index.html
Upvotes: 1