Skip to content

Relationship indexes

Max De Marzi edited this page Aug 30, 2013 · 2 revisions

List indexes

@neo.list_relationship_indexes                             # gives names and query templates for relationship indices

Create index

@neo.create_relationship_index(name, "fulltext", provider) # creates a relationship index with "fulltext" option
@neo.create_relationship_auto_index("fulltext", provider)  # creates a relationship auto index with "fulltext" option

Add relationship to index

@neo.add_relationship_to_index(index, key, value, rel1)    # adds a relationship to the index with the given key/value pair

Remove relationship from index

@neo.remove_relationship_from_index(index, key, value, rel1) # removes a relationship from the index with the given key/value pair
@neo.remove_relationship_from_index(index, key, rel1)      # removes a relationship from the index with the given key
@neo.remove_relationship_from_index(index, rel1)           # removes a relationship from the index

Get relationship from index:

@neo.get_relationship_index(index, key, value)             # exact query of the relationship index with the given key/value pair
@neo.find_relationship_index(index, key, value)            # advanced query of the relationship index with the given key/value pair
@neo.find_relationship_index(index, query)                 # advanced query of the relationship index with the given query
@neo.get_relationship_auto_index(key, value)               # exact query of the relationship auto index with the given key/value pair
@neo.find_relationship_auto_index(query)                   # advanced query of the relationship auto index with the given query

Drop a relationship index

@neo.drop_relationship_index(index)                         # drop a relationship index