【问题标题】:Neo4j Spring Data example missing annotation @IndexedNeo4j Spring Data 示例缺少注释 @Indexed
【发布时间】:2016-11-29 02:44:23
【问题描述】:

尝试在http://projects.spring.io/spring-data-neo4j/上运行neo4j spring数据示例

<dependencies>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-neo4j</artifactId>
        <version>4.1.2.RELEASE</version>
    </dependency>
</dependencies>

和

@NodeEntity
public class Movie {

  @GraphId Long id;

  @Indexed(type = FULLTEXT, indexName = "search")
  String title;

  Person director;

  @RelatedTo(type="ACTS_IN", direction = INCOMING)
  Set<Person> actors;

  @RelatedToVia(type = "RATED")
  Iterable<Rating> ratings;

  @Query("start movie=node({self}) match 
          movie-->genre<--similar return similar")
  Iterable<Movie> similarMovies;
}

但@Indexed(type = FULLTEXT, indexName = "search") 似乎在&lt;artifactId&gt;spring-data-neo4j&lt;/artifactId&gt; 中不存在
我是否必须在 pom 中添加任何其他内容?还是不推荐使用,如果是,我应该怎么做?

【问题讨论】:

    标签: java maven spring-mvc neo4j spring-data


    【解决方案1】:

    @Indexed 出现在 SDN 3 中,但不再出现在 SDN 4 中。您必须自己管理索引和约束,使用 Cypher queries。

    无耻插件:您可以使用Liquigraph 来管理您的迁移。

    【讨论】:

    • 该死的,他们应该更正这个例子......谢谢
    猜你喜欢
    • 2021-08-05
    • 2014-04-17
    • 2019-11-29
    • 2012-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多