@@ -40,6 +40,9 @@ def process_entities(entities):
4040 entity .query_buffer .buffer_size += added_size
4141
4242
43+ ################################################################################
44+ # Bulk loader
45+ ################################################################################
4346# Command-line arguments
4447@click .command ()
4548@click .argument ('graph' )
@@ -124,27 +127,28 @@ def bulk_insert(graph, host, port, password, unix_socket_path, nodes, nodes_with
124127 # Add in Graph Indices after graph creation
125128 for i in index :
126129 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 ))
128131 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 ))
130133 for z in index_create :
131- print (z [0 ].decode ("utf-8" ) )
134+ print (z [0 ].decode ("utf-8" ))
132135 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 ))
134137 print (e )
135138
136139 # Add in Full Text Search Indices after graph creation
137140 for i in full_text_index :
138141 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 ))
140143 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 ))
142145 print (index_create [- 1 ][0 ].decode ("utf-8" ))
143146 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 ))
145148 print (e )
146149 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+
148152
149153if __name__ == '__main__' :
150154 bulk_insert ()
0 commit comments