Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SDN 能否在@Index集合属性上正常工作,如下所示:
@Index
@Index(unique = false) private Set<Long> optionIds;
这是可能的并且应该有效,应该在optionIds给定标签的属性上创建索引。
optionIds
但很可能这不会像您期望的那样工作。问题来自 Neo4j 如何索引数组(以及它不能索引集合的事实 - 只有列表并且它不能索引数组中的单个元素)。
整个数组将被索引,然后可以再次被整个数组查找。如果您想按整个集合进行索引查找,请使用排序集合,以便 id 在存储的数组中始终以相同的顺序排列(Set由 OGM 存储为数组)。
Set
您不能通过索引数组中的单个元素进行索引查找。