Question

I was looking into Neo4j sometime last year before labels were introduced, and am trying to catch up to changes to get back into 2.0. What's the difference between labels and the current automatic node indexes, and how should I use them differently in modeling? Is it that labeling doesn't enforce uniqueness on a param, but indexing on that param does?

(The link on the main neo4j page is down: http://docs.neo4j.org/chunked/preview/what-is-a-graphdb.html, so I'm having trouble trying to just look this up.)

Était-ce utile?

La solution

Always use labels for exact indexing--they're more efficient and easier to use, as well as offering things like unique constraints on fields. The legacy indexes are still required for things that require lucene syntax or FTS, but hopefully the new indexes will support that functionality soon.

The main reason the new label-based indexes are more efficient is you pick which nodes you want to index by the label (there's a separate index for each label/property). With autoindexes, there was no way to do this--all nodes were indexed.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top