Gremlin.net textContains equivalent

余生长醉 提交于 2019-12-11 02:08:31

问题


I am using Gremlin.net library to connect to a janus graph server. I am usin cassandra and elasstic search for data storage and indexing. In gremlin language and gremlin console I use textContains to search within the text of a property. I am using Mixed index for that, but I can find the equivalent for that in Gremlin.net Library? can anyone help?


回答1:


Gremlin.Net will not have that. TinkerPop doesn't have text or geo search predicates that JanusGraph and other systems have. At this point, we leave it to graph providers to develop such extensions. Unfortunately, I'm not aware of any that have done that for all the Gremlin Language Variants like C#, Javascript, etc. I think that DSE Graph is the only graph provider to do that at this point.




回答2:


JanusGraph now has a library that extends Gremlin.Net for aspects that are specific to JanusGraph: JanusGraph.Net.

This library already contains text predicates. So, you can now do this directly in C#:

var songName = g.V().Has("song", "name", Text.TextContains("COMES")).Values<string>("name").Next();
Console.WriteLine(songName); // output: HERE COMES SUNSHINE


来源:https://stackoverflow.com/questions/49829955/gremlin-net-textcontains-equivalent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!