Search code examples
titangremlintinkerpop3

How to query all values in vertices using elasticsearch in Tinkerpop3 graph


I have a graph that I want to to query vertices (full text search) by text that might occur in any of the keys in each vertex. How to do that?

I use Titan 0.9.0-M2 and Tinkerpop 3. The indexing backend is Elasticsearch.


Solution

  • Let's say your index is called vertices, then you would do:

    graph.indexQuery("vertices","v.*:term").vertices()
    

    Here's an example over the Graph of the Gods:

    gremlin> graph.indexQuery("edges", "e.*:loves").edges()*.getElement()*.value("reason")
    ==>loves waves
    ==>loves fresh breezes