在neo4j中组织备用名称(昵称,别名) [英] Organize alternative names (nicknames, aliases) in neo4j

查看:404
本文介绍了在neo4j中组织备用名称(昵称,别名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设模型中的某些节点可能有多个备用名称,但是所有名称都引用同一个对象.

Say you have some nodes in your model that may go by multiple alternative names, but all the names refer to the same object.

例如,您可能希望能够通过在一个上下文中使用名称"World"来查询"World"节点,而在不同的上下文中,您也希望通过名称"Global"快速找到相同的节点.

For example, you may want to be able to query the "World" node by using name "World" in one context, whereas in different context you want to find the same node quickly also by the name "Global".

以这样的字符串数组属性aliases的形式组织此信息是否最佳? :

Is it optimal to organize this information in the form of string array property aliases like this? :

推荐答案

如果将World添加到别名中,则可以使用旧版node_auto_index对该别名字段进行索引

If you add World to your aliases you can use the legacy node_auto_index to index that aliases field

它将分别为每个值编制索引并使用

which will index each value individually and the query it with

开始n = node:node_auto_index(aliases ="Global") 返回n

Start n=node:node_auto_index(aliases="Global") return n

这篇关于在neo4j中组织备用名称(昵称,别名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆