@@ -40,6 +40,9 @@ def process_entities(entities):
40
40
entity .query_buffer .buffer_size += added_size
41
41
42
42
43
+ ################################################################################
44
+ # Bulk loader
45
+ ################################################################################
43
46
# Command-line arguments
44
47
@click .command ()
45
48
@click .argument ('graph' )
@@ -124,27 +127,28 @@ def bulk_insert(graph, host, port, password, unix_socket_path, nodes, nodes_with
124
127
# Add in Graph Indices after graph creation
125
128
for i in index :
126
129
l , p = i .split (":" )
127
- print ("Creating Index on Label: %s, Property: %s" % (l , p ))
130
+ print ("Creating Index on Label: %s, Property: %s" % (l , p ))
128
131
try :
129
- index_create = client .execute_command ("GRAPH.QUERY" , graph , "CREATE INDEX ON :%s(%s)" % (l , p ))
132
+ index_create = client .execute_command ("GRAPH.QUERY" , graph , "CREATE INDEX ON :%s(%s)" % (l , p ))
130
133
for z in index_create :
131
- print (z [0 ].decode ("utf-8" ) )
134
+ print (z [0 ].decode ("utf-8" ))
132
135
except redis .exceptions .ResponseError as e :
133
- print ("Unable to create Index on Label: %s, Property %s" % (l , p ))
136
+ print ("Unable to create Index on Label: %s, Property %s" % (l , p ))
134
137
print (e )
135
138
136
139
# Add in Full Text Search Indices after graph creation
137
140
for i in full_text_index :
138
141
l , p = i .split (":" )
139
- print ("Creating Full Text Search Index on Label: %s, Property: %s" % (l , p ))
142
+ print ("Creating Full Text Search Index on Label: %s, Property: %s" % (l , p ))
140
143
try :
141
- index_create = client .execute_command ("GRAPH.QUERY" , graph , "CALL db.idx.fulltext.createNodeIndex('%s', '%s')" % (l , p ))
144
+ index_create = client .execute_command ("GRAPH.QUERY" , graph , "CALL db.idx.fulltext.createNodeIndex('%s', '%s')" % (l , p ))
142
145
print (index_create [- 1 ][0 ].decode ("utf-8" ))
143
146
except redis .exceptions .ResponseError as e :
144
- print ("Unable to create Full Text Search Index on Label: %s, Property %s" % (l , p ))
147
+ print ("Unable to create Full Text Search Index on Label: %s, Property %s" % (l , p ))
145
148
print (e )
146
149
except :
147
- print ("Unknown Error: Unable to create Full Text Search Index on Label: %s, Property %s" % (l , p ))
150
+ print ("Unknown Error: Unable to create Full Text Search Index on Label: %s, Property %s" % (l , p ))
151
+
148
152
149
153
if __name__ == '__main__' :
150
154
bulk_insert ()
0 commit comments