0

neo4j Eclipse の実装で次の問題があります。

1. limit 関数でエラーが発生する

Code:
      String rows = "";        
    try ( Transaction ignored = graphDb.beginTx();
            Result result = graphDb.execute( "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5" ) )
      {
          while ( result.hasNext() )
          {
              Map<String,Object> row = result.next();
              for ( Entry<String,Object> column : row.entrySet() )
              {
                   rows += column.getKey() + ": " + column.getValue() + "; ";
              }
              rows += "\n";
          }
      }
    System.out.println(""+rows);

}

Output:
Exception in thread "main" org.neo4j.graphdb.QueryExecutionException: Invalid input '5': expected whitespace, comment, node labels, MapLiteral, a parameter, a relationship pattern, '(', '.', '[', "=~", IN, IS, '^', '*', '/', '%', '+', '-', '<', '>', "<=", ">=", '=', "<>", "!=", AND, XOR, OR, AS, ',', ORDER, SKIP, LIMIT, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, RETURN, UNION, ';' or end of input (line 1, column 97 (offset: 96)) "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5"                                
  1. また、制限句なしで上記のクエリを実行するのに 50 分ほどかかりました。では、パフォーマンス速度を上げるにはどうすればよいでしょうか。
4

1 に答える 1

2

の前にコンマを入れることはできませんlimits。試してください

match(pr:Provider)-[t:TREATS]->(p:Problem) 
return pr.prdes as Name, t.pprcount as Visits limit 5

代わりは。

これは開始点が定義されていないグローバル クエリであるため、実行時間はもちろんデータ サイズによって異なります。

于 2015-07-06T17:16:34.707 に答える