I've this cypher query:
MATCH (p:Person)-->(s:Startup)
WHERE p.name =~ '(?i).*something.*' OR p.description =~ '(?i).*something.*' OR s.name =~ '(?i).*something.*'
RETURN DISTINCT p, collect(DISTINCT s)
This returns:
+--------+------------+
| p | collect(s) |
+--------+------------+
| 1 | 1 |
+--------+------------+
where I was expecting:
+--------+------------+
| p | collect(s) |
+--------+------------+
| 1 | 1, 2 |
+--------+------------+
When someone search for a name, it returns me all the matched people and related startups with this criteria, but I want that it returns me all the matched people and always all the relationships between the 2 nodes.
(i.e. if I search for a startup name, I want that the result is the list of people and the startups in relationship, not only the people and the matched startup)
I hope I've explained well the issue.
My wish is to get the results in one query.