Notice: This project has migrated over to Unipop
TinkerPop 3 implementation on Elasticsearch backend. You should read up on Tinkerpop before you use elastic-gremlin.
clone & build elastic-gremlin
git clone https://github.com/rmagen/elastic-gremlin.git
mvn clean install -Dmaven.test.skip=true
Create an ElasticGraph:
BaseConfiguration config = new BaseConfiguration();
/* put configuration properties as you like*/
ElasticGraph graph = new ElasticGraph(config);
GraphTraversalSource g = graph.traversal();
g.addV();
Or just use the Gremlin Server or Gremlin Console.
Basic usage of elastic-gremlin creates or uses an existing ES index, with each Vertex and Edge contained in its own document. You can customize some of the behaviour:
elasticsearch.client
(Default: "NODE") NODE
Sets up a local elasticsearch node and runs against it. elastic-gremlin defaults to NODE, so you can get up and running as quickly as possible.TRANSPORT_CLIENT
Connects to an existing ES node.NODE_CLIENT
An optimized way to connect to an ES cluster.
For more information read hereelasticsearch.cluster.name
(Default: "elasticsearch")elasticsearch.cluster.address
(Default: "127.0.0.1:9300") elasticsearch.refresh
(Default: true) elasticsearch.index.name
(Default: "graph")elasticsearch.bulk
(Default: false) ElasticGraph.commit()
.And most importantly you can customize the ES Index's Mappings to best fit your data. You can use ES's own APIs to do it. elastic-gremlin will automatically utilize your indices as best as he can.
In addition to index mappings, ES offers many other ways to optimize your queries.
Implement QueryHandler
to use a customized schema that works best for your data.
We still don't have enough documentation on this, but you can take a look at the implementations of SimpleQueryHandler
and ModernGraphQueryHandler
You're welcome to send us any comments or questions (rmagen@gmail.com)