Very similar to the question posted here
I have the following nodes: Article and Words. Each word is connected to an article by a
I need to query all articles that have common words where the list of common words is dynamic. From the clients perspective, I am passing back a list of words and expecting back a results of articles that have those words in common.
The following query does the job
WITH ["orange", "apple"] as words MATCH (w:Word)<-[:MENTIONED]-(a:Article)-[:MENTIONED]->(w2:Word) WHERE w.name IN words AND w2.name IN words RETURN a, w, w2
but does not work with word list of one. How can I make it handle any number of words? Is there a better way to do this?