Neo4j index query with regex

痴心易碎 提交于 2020-01-04 02:56:28

问题


I am trying to get likers for some artists through an index on Name :

START n=node:Artist(Name =~ 'Michael*.')
MATCH n<-[:LIKES]-liker
return liker.Id, n.Label
LIMIT 50

And I have this error : Invalid query string literal or parameter expected "START n=node:ArtistId(Name =~ 'Michael*.')"

I am wondering how can I use regex in index query? I know I can use regex in match but I don't know how can I use regex in START.

Thanks for your help


回答1:


You can't use normal regex syntax, but you can use wildcards:

START n=node:Artist('Name:Michael*')

Edit:

Neo4J uses Apache Lucene for index queries. You have a few other cool things you can do in addition to wildcards.



来源:https://stackoverflow.com/questions/14175546/neo4j-index-query-with-regex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!