Search code examples
datastax-enterprise-graph

Tinkerpop3 textContains predicate in DSE


This link tells that textContains predicate wont be supported because of vendor incompatibilities.

Am wondering if DSE graph Java API has any specific predicate that I can use to check if a vertex has a property whose text contains X

Something like g.V().has("name", textContains("Humour")). I understand that Titan used to provide the textContains predicate


Solution

  • DSEGraph has multiple kinds of Text predicates, which are included in the Java API.

    For the available predicates and their description see http://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/graph/using/useSearchIndexes.html

    To use the predicates in the Java Fluent API see http://docs.datastax.com/en/developer/java-driver-dse/1.4/manual/tinkerpop/#search-and-geo

    For instance you can use the predicate Search.token() to replace the textContains() predicate:

    import com.datastax.dse.graph.api.predicates.Search;
    
    g.V().has("name", Search.token("Humour"))