-
Notifications
You must be signed in to change notification settings - Fork 273
The Major Differences Between Blueprints 1.x and 2.x
Blueprints 2 introduced numerous changes to the Blueprints API. This page helps to explain these differences so updating code from Blueprints 1.x to Blueprints 2.x is as easy as possible.
There is no more notion of AutomaticIndex
in Blueprints 2. Many graph databases such as DexGraph
, IGGraph
, and TitanGraph
do not support the notion of arbitrary indexing. Instead, they simply allow an element to be indexed by its key/value property pairs. As such, KeyIndexableGraph
provides an interface to this basic indexing functionality. To index a the name
key of all vertices, simply do:
graph.createKeyIndex("name", Vertex.class);
Now, when graph.getVertices("name", "stephen")
is evaluated, the name
index is used. If no such key index was created, then a linear scan of all the vertices in the graph would occur. Thus, be sure to add the appropriate indices to make an n
-lookup a log(n)
-lookup.