2016-07-25 60 views
0

試圖在http://projects.spring.io/spring-data-neo4j/Neo4j的數據春季例子裏缺了註釋@Indexed

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

運行Neo4j的春天數據的例子,但在@Indexed(type = FULLTEXT, indexName = "search")似乎並不<artifactId>spring-data-neo4j</artifactId>
我是否存在必須添加任何其他的東西嗎?或者這是否被棄用,如果是的話,我應該怎麼做?

回答

1

@Indexed已存在於SDN 3中,但SDN 4中不再存在。您必須使用Cypher queries自己管理索引和約束條件。

無恥插件:您可以使用Liquigraph來管理您的遷移。

+0

damm他們應該改正這個例子然後......謝謝 – Als