module Neography::Rest::RelationshipAutoIndexes

Public Instance Methods

add_relationship_auto_index_property(property) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 45
def add_relationship_auto_index_property(property)
  options = {
    :body => property,
    :headers => json_content_type
  }
  @connection.post("/index/auto/relationship/properties", options)
end
find_relationship_auto_index(key_or_query, value = nil) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 11
def find_relationship_auto_index(key_or_query, value = nil)
  if value
    index = find_relationship_auto_index_by_value(key_or_query, value)
  else
    index = query_relationship_auto_index(key_or_query)
  end
  return nil if index.empty?
  index
end
find_relationship_auto_index_by_value(key, value) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 21
def find_relationship_auto_index_by_value(key, value)
  @connection.get("/index/auto/relationship/%{key}/%{value}" % {:key => key, :value => encode(value)}) || []
end
get_relationship_auto_index(key, value) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 5
def get_relationship_auto_index(key, value)
  index = @connection.get("/index/auto/relationship/%{key}/%{value}" % {:key => key, :value => encode(value)}) || []
  return nil if index.empty?
  index
end
get_relationship_auto_index_properties() click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 41
def get_relationship_auto_index_properties
  @connection.get("/index/auto/relationship/properties")
end
get_relationship_auto_index_status() click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 29
def get_relationship_auto_index_status
  @connection.get("/index/auto/relationship/status")
end
query_relationship_auto_index(query_expression) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 25
def query_relationship_auto_index(query_expression)
  @connection.get("/index/auto/relationship/?query=%{query}" % {:query => query_expression}) || []
end
remove_relationship_auto_index_property(property) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 53
def remove_relationship_auto_index_property(property)
  @connection.delete("/index/auto/relationship/properties/%{property}" % {:property => property})
end
set_relationship_auto_index_status(value = true) click to toggle source
# File lib/neography/rest/relationship_auto_indexes.rb, line 33
def set_relationship_auto_index_status(value = true)
  options = {
    :body => value.to_json,
    :headers => json_content_type
  }
  @connection.put("/index/auto/relationship/status", options)
end