问题
First of all, I bet that there is an answer on this question somewhere in docs, but since 'Manual: Labels and Indexes' link here gives me 404 error, I'm going to ask you anyway.
Is it possible to create an index on some label and specify it as an automatic one (just like legacy indexes I'm currently using, but for labels)?
If someone from neo4j team is reading this post, please let me know if I'm looking for the documentation in the right place, 'cause I can't find anything more or less informative on labels and indexes (except a couple of posts in Michael Hunger's blog and, maybe, some presentations, what is obviously not enough).
This is a more technical one: is it possible to find an item in the index by the regex? Suppose I have node with property
'n' -> '/a/b/c'
, and another node'n' -> '/a/*/c
. Can I somehow match them?
回答1:
I don't work for Neo4j but I'll answer anyway.
- All label indexing is automatic. Once you've created the index it maintains itself, possibly with minimal delay.
- The manual for the last stable release can always be found here. The chapter on indexing for the embedded Java API is here.
You cannot use regexp with label indices yet. It's said to be on the agenda, along with index support for array lookups, i.e. what in Cypher would be
MATCH (a:MyLabel) WHERE a.value IN ['val1', 'val2']
来源:https://stackoverflow.com/questions/22049121/does-label-mechanism-provide-auto-indexing-features-when-using-neo4j-java-api