1

我有一个名为植物的索引。我已经使用名称索引了一堆节点:index -i plants name

当我使用 shell index 命令进行查询时,我可以使用 *. 当我使用 Cypher 时,通配符不起作用。但是,完全匹配确实如此。为什么通配符在 Cypher 中不起作用?我的语法错了吗?

neo4j-sh (foo,0)$ start n=node:plants(name="*")
> return n;
+---+
| n |
+---+
+---+
0 row
0 ms

neo4j-sh (foo,0)$ index -q plants name "*"
(me)
(Broccoli,23)
(Basil,24)
(Kale,22)
(Brussel_sprouts,30)
(Sunflowers,27)
(Cilantro,26)
(Parsley,28)
(Beets,25)
(Corn,1)
(Cauliflower,17)
(Lettuce,18)
(Pumpkin,15)
(Garlic,16)
(Tomato,13)
(Beans,14)
(Peas,19)
(Potatoes,20)
(Favas,21)
(Cabbage,12)
(Cucumber,11)
(Onions,5)
(Carrots,3)

neo4j-sh (foo,0)$ start n=node:plants(name="Corn")

> return n;
+----------------------------------+
| n                                |
+----------------------------------+
| Node[1]{name:"Corn",height:"84"} |
+----------------------------------+
1 row
2 ms

neo4j-sh (foo,0)$ 
4

1 回答 1

3

对于这种查询,您必须使用 Lucene 语法。像这样:

start n=node:plants("name:*")
...
于 2013-01-26T06:34:28.537 回答