Titan Elasticsearch Automatic Index Creation Titan Elasticsearch Automatic Index Creation elasticsearch elasticsearch

Titan Elasticsearch Automatic Index Creation


Titan indexes must be defined before the respective property key is first used, however, they can be defined while the database is running and therefore must not be defined a priori.

In other words, you just need to define the index when the property is first seen so that Titan knows what to do with it. You don't have to predefine all of those up front.

For example:

TitanKey key = graph.getType("yourkey");if (key==null) { //First time we have seen it, let's define it    key = graph.makeKey("yourkey").dataType(String.class).indexed("search",Vertex.class).make()}v.setProperty(key,"yourvalue");