为什么neo4j-shell索引查询工作和cypher返回0行

时间:2013-01-26 06:27:19

标签: neo4j

我有一个名为植物的索引。我使用名称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)$ 

1 个答案:

答案 0 :(得分:3)

您必须对此类查询使用Lucene语法。像这样:

start n=node:plants("name:*")
...