4

Neo4j's legacy indexes offer functionality like doing Lucene queries on them, or indexing arbitrary key/value pairs.

For example, if my User node looks like this: (me { FirstName: 'John', LastName: 'Doe'}), I can put this user in a legacy index with a key of FullName, a value of 'john doe', and I can get this user and other users whose name starts with a 'j' with this Cypher query:

start withj=node:User("FullName:j*") return withj;

I'm thinking of converting my legacy index based application to Neo4j 2.0's label based indexes. Do these new indexes also offer this functionality or only searches on exact matches? Should I stick to legacy indexes for this kind of queries, or are there alternatives?

Thanks!

Jan Van den bosch
  • 3,542
  • 3
  • 26
  • 38
  • 1
    No they don't yet, this will be supported in a future version, which will probably just push certain expressions of your where clause down to the index providers. – Michael Hunger Nov 05 '13 at 11:50
  • If the index isn't solely for speed, you could use the Regular Expression operator (=~) in a WHERE clause for case-insensitive match. Ex: WHERE withj.FullName =~ "(?i)j.*" – LameCoder Nov 06 '13 at 20:28
  • @MichaelHunger, any idea when regex searches on labels will use the index? Is it already on the release plan, or is there a github issue that can follow? – tstorms Mar 04 '14 at 14:55
  • Full text indexing will arrive, it's just a matter of when. There is not yet anyone working actively on it. – Jacob Davis-Hansson Apr 07 '14 at 10:20
  • Please note that labels are typically meant as a 'classification', not a property itself. When you label something you mean that "It's a ___", whereas properties (such as your FullName example) are more of the fields that describe the state of the ___. – Dan G Sep 30 '15 at 14:55

0 Answers0