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?
Asked
Active
Viewed 744 times
2 Answers
3
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.

stephen mallette
- 45,298
- 5
- 67
- 135
-
Thanks for the replay. but I can execute g.V().has('FirstName', textContains('Janus')).next() Using gremlin terminal? how can I do that if the gremlin doesn't support text search. – janus graph Apr 14 '18 at 10:43
-
The Gremlin Console is based in the JVM - groovy specifically, but obviously that includes java. JanusGraph is written in Java and thus the text/geo libraries are available there. You are likely using the JanusGraph version of the Gremlin Console which will import those Java-based text/geo classes from JanusGraph automatically for you on startup which is why they are available. My point wasn't that those classes don't exist - just that JanusGraph has only built them for Java and not the other languages that TinkerPop supports, like .NET – stephen mallette Apr 14 '18 at 11:06
-
Thanks I get the point. but how can I perform such a query, do you have a work around. – janus graph Apr 16 '18 at 14:52
-
2The only workaround I can think of for .NET and other GLVs is that for requests that require text/geo, you will need to drop back to the script api and send Gremlin as strings based requests. – stephen mallette Apr 16 '18 at 15:31
1
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

Florian Hockmann
- 2,634
- 13
- 24