Index

Show Index

  • Show all indexes:
ShowIndexRequest request = new ShowIndexRequest();
println(client.showIndex(request));
  • Show fulltext indexes:
ShowIndexRequest request = new ShowIndexRequest();
request.setFulltext(true);
println(client.showIndex(request));

Create Index

  • Create general index for node property:
CreateIndexRequest request = new CreateIndexRequest();
request.setFulltext(false);
request.setNodeProperty(nodePropertyName);
client.createIndex(request);
  • Create general index for edge property:
CreateIndexRequest request = new CreateIndexRequest();
request.setFulltext(false);
request.setEdgeProperty(edgePropertyName);
client.createIndex(request);
  • Create fulltext index (for edge property as example):
CreateIndexRequest request = new CreateIndexRequest();
request.setFulltext(true);
request.setEdgeProperty(edgePropertyName);
request.setName(edgeIndexName);
client.createIndex(request);

Drop Index

  • Drop general index of node property:
DropIndexRequest request = new DropIndexRequest();
request.setNodeProperty(nodePropertyName);
client.dropIndex(request);
  • Drop general index of edge property:
DropIndexRequest request = new DropIndexRequest();
request.setEdgeProperty(edgePropertyName);
client.dropIndex(request);
  • Create fulltext index (of edge property as example):
DropIndexRequest request = new DropIndexRequest();
request.setName(edgeIndexName);
request.setFulltext(true);
client.dropIndex(request);