我正在使用neo4j-rest-graphdb,試圖用Cypher來獲取簡單的Node結果。Slow Cypher neo4j使用REST GraphDb時的結果
CypherParser parser = new CypherParser();
ExecutionEngine engine = new ExecutionEngine(graphDbService);
Query query = parser.parse("START referenceNode = node (0) " +
"MATCH referenceNode-[PRODUCTS_REFERENCE]->products-[PRODUCT]->product " +
"RETURN product.productName " +
"ORDER BY product.productId " +
"SKIP 20"
"LIMIT 10");
ExecutionResult result = engine.execute(query);
Iterator<Map<String, Object>> iterator = result.javaIterator();
遍歷結果的最佳實踐是什麼?最後一行導致我的服務掛起〜6秒。如果沒有迭代器,應用程序就會很安靜。我也試過webadmin密碼終端,結果在50ms內獲取。難道我做錯了什麼?
是啊,這就是我一直在尋找! :)非常感謝Micahel! – Alebon