AWS Neptune Gremlin Composite Index

Viewed 812

I'm using gremlin-java. And I want to create a unique index and a composite-index. But Graph object doesn't provide createIndex function. I will work on aws-neptune.

Is there a way to create composite-index and unique-index on aws-neptune?

My expected indexes are:

CREATE INDEX ON :`VertexLabel1`(`country`,`value`)
CREATE UNIQUE INDEX ON :`VertexLabel2`(`x_id`)

Graph configuration:

@Bean
public Cluster gremlinCluster()
{
    return Cluster.build()
            .addContactPoint(GREMLIN_ENDPOINT)
            .port(GREMLIN_PORT)
            .enableSsl(GREMLIN_SSL_ENABLED)
            .create();
} 
...
@Bean
public GraphTraversalSource gremlinGraph(Cluster gremlinCluster)
{
    return traversal().withRemote(DriverRemoteConnection.using(gremlinCluster, "g"));
}
1 Answers

Every property and label that you add to Neptune is automatically indexed three different ways. There is no need to explicitly create an index. In fact Neptune does not have an index creation API. However, you can optionally enable integration with Elastic Search if you need to do full text search type indexing. The documentation describing the Neptune indices is here:

https://docs.aws.amazon.com/neptune/latest/userguide/feature-overview-data-model.html

Related