I am using Titan Server (Cassandra) v 0.3.1. I would like to create an index for the vertex key / property that I have already started using. However, in its documentation, Titan explains that:
To index vertices by key, you must create the corresponding key index before the key is first used in the vertices property.
If I try to create an index in an existing field, I see an error as expected:
gremlin> g.createKeyIndex("my_key",Vertex.class) Cannot add an index to an already existing property key: my_key
However, even if I try to clear the graph by deleting all the vertices and edges, I see the same error:
gremlin> gEremove() ==>null gremlin> gVremove() ==>null gremlin> g.createKeyIndex("my_key",Vertex.class) Cannot add an index to an already existing property key: my_key
Thus, it seems that my_key stored in the underlying data store even after deleting all the graph elements. This is consistent with the documents (although the elements were deleted, the property was already βfirst usedβ), but it seemed to be worth taking a picture.
The next step will be to re-create the new Cassandra data warehouse, but I wonder if there is a better option.
What is the easiest way to create an index on a field that has already been used in Titan?
source share