Neo4j Spring Data example missing annotation @Indexed

老子叫甜甜 提交于 2019-12-25 07:59:15

问题


Trying to run the neo4j spring data example on http://projects.spring.io/spring-data-neo4j/

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

And

@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;
}

but the @Indexed(type = FULLTEXT, indexName = "search") does not seem to exist in <artifactId>spring-data-neo4j</artifactId>
Do I have to add anything else to the pom ? or is this deprecated and if so how should I do it?


回答1:


@Indexed was present in SDN 3, but not anymore in SDN 4. You have to manage indices and constraints yourself, using Cypher queries.

Shameless plug: you can use Liquigraph to manage your migrations.



来源:https://stackoverflow.com/questions/38573148/neo4j-spring-data-example-missing-annotation-indexed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!