Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j:SDN4中的Lucene查询语法_Neo4j_Lucene_Cypher_Spring Data Neo4j_Spring Data Neo4j 4 - Fatal编程技术网

Neo4j:SDN4中的Lucene查询语法

Neo4j:SDN4中的Lucene查询语法,neo4j,lucene,cypher,spring-data-neo4j,spring-data-neo4j-4,Neo4j,Lucene,Cypher,Spring Data Neo4j,Spring Data Neo4j 4,有人能解释一下适当的Cypher查询语法,从下面提到的存储库查询中得到以下结果吗?下面提到的团队名称已保存到存储库中 洛杉矶湖人队 洛杉矶阿纳海姆快船队 金州勇士队 阿纳海姆的洛杉矶打手 洛杉矶阿纳海姆拖鞋 我被建议使用下面的密码,它最终会出现在NPE中。 NullPointerException: Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner

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

  • 洛杉矶湖人队
  • 洛杉矶阿纳海姆快船队
  • 金州勇士队
  • 阿纳海姆的洛杉矶打手
  • 洛杉矶阿纳海姆拖鞋
我被建议使用下面的密码,它最终会出现在NPE中。

NullPointerException:

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)
线程“main”java.lang.IllegalStateException中的异常:无法执行CommandLineRunner 位于org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:675) 位于org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690) 位于org.springframework.boot.SpringApplication.run(SpringApplication.java:321) 位于org.springframework.boot.SpringApplication.run(SpringApplication.java:957) 位于org.springframework.boot.SpringApplication.run(SpringApplication.java:946) 位于com.directv.service.Sports.main(Sports.java:134) 原因:java.lang.NullPointerException 位于org.apache.lucene.util.SimpleStringInterner.intern(SimpleStringInterner.java:54) 位于org.apache.lucene.util.StringHelper.intern(StringHelper.java:39) 位于org.apache.lucene.index.Term.(Term.java:38) 位于org.apache.lucene.queryParser.queryParser.getFieldQuery(queryParser.java:643)
经过反复尝试,我终于解决了这个问题。正如@Michael Hunger指出的,这是查询中嵌入空格字符的问题。合适的查询是:
@Query(“开始团队=节点:团队名称(*洛杉矶队将进入黄金状态*))返回团队”)

经过一些尝试和错误,我能够解决这个问题。正如@Michael Hunger指出的,这是查询中嵌入空格字符的问题。合适的查询是:
@Query(“START team=node:teamName('teamName:(*洛杉矶队将进入黄金状态*))RETURN team”)

您的查询字符串看起来像是lucene的问题。请确保引用(反斜杠)空格。您可以共享导致此错误的lucene查询字符串吗?@Michael Hunger查询字符串只是纯文本:
teamRepository.findByTeamName(“洛杉矶将在黄金状态下比赛”)teamRepository.findByTeamName(“洛杉矶将在黄金状态下比赛”)不幸的是,您必须在那里逃出空格。
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)