-
Dec 21st, 2011, 06:45 AM
#1
Facing issues with cypher query support
Hi
We are using SpringData 2.0.0 RC1 and Neo4J as our primary datastore.
For searching, we are creating using the following at the repository level -
public interface UserRepository extends GraphRepository<User>, NamedIndexRepository<User> {
public final static String USR_SRCH_QUERY="start unode = node:__types__(className=\"User\") " +
"match (unode)-[r1]->(folder)-[r2]-(member) " +
"where (member.firstName=~/A.*/) and" +
"type(r1)=~/HAS_FOLDER|MEMBERSHIP/ and type(r2)=~/CONTACT|MEMBERSHIP/ " +
"and unode.userName=/a.*/ " +
"return member, type(r2) " +
"order by type(r2), member.role,member.firstName, member.lastName, member.userName";
@Query(USR_SRCH_QUERY)
public List<UserSearchNode> getUsersInCommunity(String currentUser, String searchQuery);
}
We have an object that is used to map the result -
@MapResult
public interface UserSearchNode {
@ResultColumn("member")
User getUserNode();
@ResultColumn("TYPE(r2)")
String getRelType();
}
we are invoking this through some test as follows
String usr = "a.b@gmail.com";
List<UserSearchNode> usersNodes = userDao.getUsersInCommunity(usr,"a");
for (UserSearchNode userNode : usersNodes) {
System.out.println(userNode.getRelType() + ":" + userNode.getUserNode().getUserName());
}
On invocation the query doesnt work saying - SyntaxException - expected ')'; 'r' found.
if we change the expression for matching username to - 'and unode.userName=/(?i)a.*/', then we dont get the correct result.
We printed the query that is formed and sent across to neo4J and tried it on the cypher console - the query works perfectly.
Can someone help us solve this?
-
Dec 22nd, 2011, 02:21 AM
#2
As mentioned in the neo4j google group, this is a bug in cypher in older versions of Neo4j will be resolved tomorrow, when we release SDN 2.0 with support for Neo4j 1.6.M02.
Cheers
Michael
-
Dec 25th, 2011, 04:18 AM
#3
Please check and report back.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules