使用正则表达式进行Neo4j索引查询 [英] Neo4j index query with regex
问题描述
我试图通过姓名上的索引为一些艺术家提供赞成:
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
我有这个错误:
无效查询
字符串文字或参数预期
START n = node: ArtistId(Name = ~'Michael *。')
And I have this error : Invalid query string literal or parameter expected "START n=node:ArtistId(Name =~ 'Michael*.')"
我想知道如何在索引查询中使用正则表达式?
我知道我可以在比赛中使用正则表达式,但我不知道如何在START中使用正则表达式。
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.
感谢您的帮助
推荐答案
您不能使用普通的正则表达式语法,但可以使用通配符:
You can't use normal regex syntax, but you can use wildcards:
START n=node:Artist('Name:Michael*')
编辑:
Neo4J使用 Apache Lucene 以进行索引查询。除了通配符之外,你还可以做一些其他很酷的事情。
Neo4J uses Apache Lucene for index queries. You have a few other cool things you can do in addition to wildcards.
这篇关于使用正则表达式进行Neo4j索引查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!