简体   繁体   English

如何在 Neo4J 中以简单的方式索引关系属性

[英]How to index relationship properties in Neo4J in an easy way

I want to index the existing relationship properties in Neo4J (2.0.1) and also to set up automatic indexing for the ones that will appear in the future.我想索引 Neo4J (2.0.1) 中现有的关系属性,并为将来出现的关系设置自动索引。

I found out that it's possible to do that in Neo4J documentation through the legacy auto-indexing as well as the examples of some Java code .我发现在 Neo4J 文档中可以通过遗留的自动索引以及一些 Java 代码的示例来做到这一点。

However, as I'm neither an expert in Java, nor want to use "legacy" functionality, I wanted to ask you if there is an easy way to index relationships on a specific property using Cypher command or any other way (rest API?) that wouldn't involve me having to write some Java program and run it (I don't know how to do that).但是,由于我既不是 Java 专家,也不想使用“遗留”功能,我想问您是否有一种简单的方法可以使用 Cypher 命令或任何其他方式(rest API? ) 这不会让我不得不编写一些 Java 程序并运行它(我不知道该怎么做)。

Thank you for your help!感谢您的帮助!

My original answer was wrong.我原来的答案是错误的。 Editing so that it doesn't generate confusion to others looking for a solution.进行编辑,以免给寻求解决方案的其他人造成混淆。

Please refer to Relationship Labels and Index in Neo4J a for correct answer, as @deemeetree pointed out in the comments.正如@deemeetree 在评论中指出的那样,请参阅Neo4J a 中的关系标签和索引以获取正确答案。

You can't do indexing on relationship.您不能对关系进行索引。 Indexing is done only on nodes.索引仅在节点上完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM