From a346ddcd1768d2f530db4c223f61613e89008410 Mon Sep 17 00:00:00 2001 From: Hesham Amiri Date: Mon, 17 Oct 2011 08:51:13 +0400 Subject: [PATCH] fix add node to index --- Gemfile.lock | 3 ++- lib/neography/rest.rb | 5 +++-- neography.gemspec | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f7630b3..7ea6ada 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,6 +14,7 @@ GEM httparty (0.7.4) crack (= 0.1.8) json (1.4.6) + json (1.4.6-java) net-http-spy (0.2.1) rake (0.8.7) rspec (2.0.1) @@ -34,6 +35,6 @@ PLATFORMS DEPENDENCIES fakeweb (~> 1.3.0) neography! - net-http-spy (~> 0.2.1) + net-http-spy (= 0.2.1) rake (~> 0.8.7) rspec (~> 2.0.0.beta.22) diff --git a/lib/neography/rest.rb b/lib/neography/rest.rb index 624e9ac..7e2daba 100644 --- a/lib/neography/rest.rb +++ b/lib/neography/rest.rb @@ -244,8 +244,9 @@ def create_node_index(name, type = "exact", provider = "lucene") end def add_node_to_index(index, key, value, id) - options = { :body => (self.configuration + "/node/#{get_id(id)}").to_json, :headers => {'Content-Type' => 'application/json'} } - post("/index/node/#{index}/#{key}/#{value}", options) + options = { :body => ({:uri => self.configuration + "/node/#{get_id(id)}", :key => key, :value => value }).to_json, :headers => {'Content-Type' => 'application/json'} } + #post("/index/node/#{index}/#{key}/#{value}", options) + post("/index/node/#{index}", options) end def remove_node_from_index(*args) diff --git a/neography.gemspec b/neography.gemspec index 252a18c..dc7e9a5 100644 --- a/neography.gemspec +++ b/neography.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_development_dependency "rspec", "~> 2.0.0.beta.22" - s.add_development_dependency "net-http-spy", "~> 0.2.1" + s.add_development_dependency "net-http-spy", "0.2.1" s.add_development_dependency "fakeweb", "~> 1.3.0" s.add_development_dependency "rake", "~> 0.8.7" s.add_dependency "httparty", "~> 0.7.3"