在cypher查询中强制索引时出错

poo*_*ank 1 neo4j cypher

我使用的是Neo4j的2.0.1版本.

我有一个名为prod的标签和一个名为id的属性.

我怀疑如下:

以下查询返回结果非常快:

profile match (p:PROD) where p.id="111" return p;

SchemaIndex(identifier="n", _db_hits=0, _rows=2, label="Prod", query="Literal(111)", property="id")
Run Code Online (Sandbox Code Playgroud)

但是当我使用IN并强制使用索引时使用列表:

profile match (p:PROD) USING INDEX p:PROD(id) where p.id IN ["111","222"] return p;
Run Code Online (Sandbox Code Playgroud)

它显示以下错误:

IndexHintException: Cannot use index hint in this context. The label and property comparison must be specified on a non-optional node
Label: `prod`
Property name: `id`
Run Code Online (Sandbox Code Playgroud)

为什么我不能使用USE INDEX方法来指定索引.我究竟做错了什么?我该如何纠正呢?

Ste*_*ter 5

WHERE使用IN运算符的条件不使用Neo4j 2.0.x中的索引.请升级到支持此操作的2.1.3.