I've got a Neo4j database in which hashtags and tweets are stored.
Every tweet has a topic
property, which defines the topic it belongs to.
If I run the following query, I get the most popular hashtags in the db, no matter the topic:
MATCH (h:Hashtag)
RETURN h.text AS hashtag, size( (h)<--() ) AS degree ORDER BY degree DESC
I'd like to get the most popular tags for a single topic. I tried this:
MATCH (h:Hashtag)<--(t:Tweet{topic:'test'})
RETURN h.text AS hashtag, size( (h)<--(t) ) AS degree ORDER BY degree DESC
this
MATCH (h:Hashtag)
RETURN h.text AS hashtag, size( (h)<--(t:Tweet{topic:'test'}) ) AS degree ORDER BY degree DESC
while the next one takes forever to run
MATCH (h:Hashtag), (t:Tweet)
WHERE t.topic='test'
RETURN h.text AS hashtag, size( (h)<--(t) ) AS degree ORDER BY degree DESC
What should I do? Thanks.