简体   繁体   English

使用正则表达式进行 Neo4j 索引查询

[英]Neo4j index query with regex

I am trying to get likers for some artists through an index on Name :我正在尝试通过 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*.')"我有这个错误:无效的查询字符串文字或参数预期“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.我知道我可以在 match 中使用正则表达式,但我不知道如何在 START 中使用正则表达式。

Thanks for your help谢谢你的帮助

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. Neo4J 使用Apache Lucene进行索引查询。 You have a few other cool things you can do in addition to wildcards.除了通配符之外,您还可以做一些其他很酷的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM