Skip to content

Commit

Permalink
Index internal ID fields
Browse files Browse the repository at this point in the history
Signed-off-by: Bartosz Zurkowski <zurkowski.bartosz@gmail.com>
  • Loading branch information
bzurkowski committed Apr 17, 2020
1 parent 8c9edf3 commit 7976214
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions orca/graph/drivers/arangodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ def _graph(self):
self.__graph = self._use_graph('graph')
return self.__graph

@property
def _nodes(self):
return self._graph.vertex_collection('nodes')

@property
def _links(self):
return self._graph.edge_collection('links')

def setup(self):
sys_db = self._use_database('_system')
if not sys_db.has_database(self._database_name):
Expand All @@ -81,6 +73,13 @@ def setup(self):
from_vertex_collections=['nodes'],
to_vertex_collections=['nodes'])

nodes_col = graph.vertex_collection('nodes')
nodes_col.add_hash_index(fields=['id'], unique=False)

links_col = graph.edge_collection('links')
links_col.add_hash_index(fields=['id'], unique=False)


def get_nodes(self, **query):
query_pattern = ('FOR node in nodes %(filters)s RETURN node')
filters = self._build_filters(query, handle='node')
Expand Down

0 comments on commit 7976214

Please sign in to comment.