Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-01-2021 05:40 AM
MATCH (l:WORD)<--(k:SENTENCE)
WITH l
MATCH (l)-[*]-(n:SENTENCE)
WHERE n.name CONTAINS l.name
WITH n.name AS NodeContainingTheWords, l.name AS TheWord
RETURN NodeContainingTheWords, TheWord
Returns the following
I want to group 1 and 2 so that I can ORDER BY which :SENTENCE CONTAINS the most WORDS
Solved! Go to Solution.
07-01-2021 05:48 AM
Hello @VilladsClaes
You can aggregate by words or sentences with collect():
RETURN NodeContainingTheWords, collect(TheWord) AS words
Or
RETURN TheWord, collect(NodeContainingTheWords) AS sentences
Regards,
Cobra
07-01-2021 05:48 AM
Hello @VilladsClaes
You can aggregate by words or sentences with collect():
RETURN NodeContainingTheWords, collect(TheWord) AS words
Or
RETURN TheWord, collect(NodeContainingTheWords) AS sentences
Regards,
Cobra
All the sessions of the conference are now available online