Neo4j:SDN4 中的 Lucene 查询语法

Neo4j: Lucene query syntax in SDN4

有人可以解释适当的 Cypher 查询语法以从下面提到的存储库查询中获得以下结果吗?下面提到的团队名称已保存到存储库中。

有人建议我使用下面的 Cypher,它最终出现在 NPE 中。 Neo4j: Native Java API(or equivalent cypher query) in Spring Data Neo4j

    //Repository     
    public interface TeamRepository extends GraphRepository<Team>
    {
        @Query("start team=node:teamName({0}) RETURN team")
        List<Team> findByTeamName(String query);
    }

下面的调用在如下调用时抛出 NPE:

teamRepository.findByTeamName("The Los Angeles Will be Playing in a state of Golden");

空指针异常:

Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:675)
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
    at com.directv.service.Sports.main(Sports.java:134)
Caused by: java.lang.NullPointerException
    at org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54)
    at org.apache.lucene.util.StringHelper.intern(StringHelper.java:39)
    at org.apache.lucene.index.Term.<init>(Term.java:38)
    at org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:643)

经过反复试验,我解决了这个问题。正如@Michael Hunger 指出的那样,这是 query.The 适当查询中嵌入的 space 字符的问题: @Query("START team=node:teamName('teamName:(*The Los Angeles Will be Playing in a state of Golden*)') RETURN team")