Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Gremlin query same sql like for search feature

Im using OrientDB type graph. I need syntax of Gremlin for search same SQL LIKE operator

LIKE 'search%' or LIKE '%search%'

I've check with has and filter (in http://gremlindocs.com/). However it's must determine exact value is passed with type property. I think this is incorrect with logic of search.

Thanks for anything.

like image 813
Minh Loc Avatar asked Sep 30 '13 01:09

Minh Loc


2 Answers

For Cosmos Db Gremlin support

g.V().has('foo', TextP.containing('search'))

You can find the documentation Microsoft Gremlin Support docs And TinkerPop Reference

like image 77
Chris Stubbs Avatar answered Sep 20 '22 22:09

Chris Stubbs


For JanusGraph with Gremlin Python (gremlin_python):

from gremlin_python.process.traversal import TextP
g.V().has('foo', TextP.containing('search'))

Source: https://docs.janusgraph.org/index-backend/text-search/

like image 45
Thiago Falcao Avatar answered Sep 23 '22 22:09

Thiago Falcao