【发布时间】:2020-05-26 02:14:48
【问题描述】:
海王星 1.0.2.1 + Gremlin + nodejs。
我有一个顶点和属性,例如Vertex - 设备,属性 - 测试,测试属性可以存储不同类型的数据,例如数字和字符串
顶点 1 - 测试 = ['ABCD','xyz'] 顶点 2 - 测试 = [123,'XYZ']
我想做一个“包含”搜索,例如无论数据类型如何,Test=A 或 Test=123。
我在尝试
queryText = 'BC' //this throw error
or queryText = 123 //this actually works
//I expect both case should hit the result.
g.V().hasLabel('Device').or(__.has('Test', parseFloat(queryText)), __.has('Test', textP.containing(queryText)));
但得到'InternalFailureException\'错误
无论数据类型如何,我都可以编写一个查询吗?
如果不可能,或者至少在我知道数据类型的情况下使 textP. contains 与多个查询一起工作?现在如果属性包含数字,则包含搜索抛出错误
【问题讨论】:
-
您使用的是哪个版本的海王星引擎?到目前为止,我无法重现您看到的错误。这对我的一个 grapgs 有用。 gremlin> g.V('3').or(has('city',TextP. contains('sti')),has('city',123))
-
查看答案 我认为您的括号放错了位置。
标签: node.js gremlin amazon-neptune