2014-01-18 100 views
0

我有这样的Neo4j - 如何使用executeCypher使用PARAMS

start n = node:node_auto_index('ids:"123", "456" ... ') return n 

这里123,456查询键是作为一个单一的PARAM {list}里的列表来提出这个查询。现在,当我尝试写这在Java中

String q = " START n=node:node_auto_index('key:{ids}') return n " 
Map<String, Object> map = new HashMap<String, Object>(); 
map.put("ids", keyList); // keyList is a list of strings 

但不知何故,调用graphstoreclient.executeCypher(q, map)失败,语法错误,你能指出我有这方面的文件/正确的语法。

PS - 此查询在控制台上正常工作。

回答

2

既然你提供一个Lucene查询字符串,参数化整个字符串:

String q = " START n=node:node_auto_index({ids}) return n " 
Map<String, Object> map = new HashMap<String, Object>(); 
map.put("ids", keyList); 

键列表现在看起来应该ids:"123", "456" ...