像薛定谔猫一样的Ne04j指数/约束 - 是否存在?

时间:2013-11-14 17:17:11

标签: indexing neo4j constraints

我的数据库好像被搞砸了。约束失败,相应的索引标记为“FAILED”(见下文)。

我认为删除/重新创建约束或索引会重建它,但是没有 - 当我尝试创建时我告诉它已经存在,当我丢弃时我告诉它不会。

关于如何(a)避免陷入这种情况以及(b)如何摆脱它的任何想法?

Neo的任何人都希望我的数据库看(它不是很大 - 可能是50MB)?

neo4j-sh (?)$ schema
Indexes
  ON :Interest(uvid) FAILED (for uniqueness constraint) 
  ON :Interest(uiid) ONLINE (for uniqueness constraint) 
  ON :Offer(uoid)    ONLINE (for uniqueness constraint) 
  ON :Product(upid)  ONLINE (for uniqueness constraint) 
  ON :User(uuid)     ONLINE (for uniqueness constraint) 

Constraints
  ON (user:User) ASSERT user.uuid IS UNIQUE
  ON (product:Product) ASSERT product.upid IS UNIQUE
  ON (interest:Interest) ASSERT interest.uiid IS UNIQUE
  ON (offer:Offer) ASSERT offer.uoid IS UNIQUE

neo4j-sh (?)$ create constraint on (i:Interest) assert i.uvid is unique;
CypherExecutionException: Already constrained CONSTRAINT ON ( interest:Interest ) ASSERT interest.uvid IS UNIQUE.
neo4j-sh (?)$ drop constraint on (i:Interest) assert i.uvid is unique;  
CypherExecutionException: Unable to drop CONSTRAINT ON ( interest:Interest ) ASSERT interest.uvid IS UNIQUE:
No such constraint CONSTRAINT ON ( interest:Interest ) ASSERT interest.uvid IS UNIQUE.

neo4j-sh (?)$ drop index on :Interest(uvid);
CypherExecutionException: Unable to drop index on :Interest(uvid): Index belongs to constraint: :Interest(uvid)
neo4j-sh (?)$ create index on :Interest(uvid);
CypherExecutionException: Already constrained CONSTRAINT ON ( interest:Interest ) ASSERT interest.uvid IS UNIQUE.

3 个答案:

答案 0 :(得分:0)

这确实听起来像个错误。您能否在http://www.github.com/neo4j/neo4j

为此提出问题

答案 1 :(得分:0)

感谢您报告此事。这是我们希望尽快解决的错误。目前,您无法使用公共API修复它。对不起你的麻烦,这绝对是我们的待办事项列表。

Stefan

答案 2 :(得分:0)

发布为https://github.com/neo4j/neo4j/issues/1492,以及创建带错误的数据库的方法。

后续里程碑或发布的任何时间表?