我使用标签概念查询了与另一个类似的搜索元素:
START similar=node:TYPE_INDEX("type1"), to=node(20325)
match similar-[:TAGGED]->tag<-[:TAGGED]-to
return distinct similar, count(tag)
order by count(tag) DESC
“相似”是一组使用 type 属性索引的节点。“至”是我必须与“相似”节点进行比较的节点。
类似的查询本身返回 500 个节点,关系 TAGGED 的计数为 3000。标记节点为 500。在我的机器上,此查询需要 50 秒。
删除 order by 子句和/或 count 子句不会提高性能。