maxdemarzi / neography

A thin Ruby wrapper to the Neo4j Rest API
MIT License
603 stars 139 forks source link

create_spatial_index throws "No index provider 'spatial' found" for Neo4j 3.0 #212

Open seenickcode opened 7 years ago

seenickcode commented 7 years ago

Hello.

Does Neography Support Neo4j 3.0 with the Neo4j Spatial Plugin still?

It seems that $neo.create_spatial_index("myindex") throws the following error with Neo4j 3.0 and Neo4j-Spatial. On the other hand, it works fine with Neo4j 2.3.1.

Neography::NeographyError: NeographyError: 
--message: No index provider 'spatial' found. Maybe the intended provider (or one more of its dependencies) aren't on the classpath or it failed to load., 
--code: 400, 
--stacktrace: , 
--request: {:path=>"/db/data/index/node", :body=>"{\"name\":\"venues\",\"config\":{\"provider\":\"spatial\",\"geometry_type\":\"point\",\"lat\":\"lat\",\"lon\":\"lon\"}}"}, 
--index: 0
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:250:in `raise_errors'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:222:in `handle_4xx_500_response'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:193:in `return_result'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:164:in `evaluate_response'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:76:in `block (3 levels) in <class:Connection>'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:89:in `log'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/connection.rb:67:in `block (2 levels) in <class:Connection>'
    from /Users/seenickcode/.rvm/gems/ruby-2.1.2/gems/neography-1.8.0/lib/neography/rest/spatial.rb:120:in `create_spatial_index'
    from (irb):85
    from /Users/seenickcode/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'

I'm using Neography 1.8.0, Neo4j 3.0 and the Neo4j Spatial Plugin (downloaded via https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/0.19-neo4j-3.0.3/neo4j-spatial-0.19-neo4j-3.0.3-server-plugin.jar?raw=true)

I have confirmed that the plugin is installed for Neo4j 3.0 via:

curl http://localhost:7474/db/data/
{
  "extensions" : {
    "SpatialPlugin" : {
      "addSimplePointLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer",
      "addNodesToLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodesToLayer",
      "findClosestGeometries" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findClosestGeometries",
      "addGeometryWKTToLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addGeometryWKTToLayer",
      "findGeometriesWithinDistance" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance",
      "addEditableLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addEditableLayer",
      "addNodeToLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer",
      "addCQLDynamicLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addCQLDynamicLayer",
      "getLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/getLayer",
      "findGeometriesInBBox" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesInBBox",
      "updateGeometryFromWKT" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/updateGeometryFromWKT",
      "findGeometriesIntersectingBBox" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesIntersectingBBox"
    }
  },
  "node" : "http://localhost:7474/db/data/node",
  "relationship" : "http://localhost:7474/db/data/relationship",
  "node_index" : "http://localhost:7474/db/data/index/node",
  "relationship_index" : "http://localhost:7474/db/data/index/relationship",
  "extensions_info" : "http://localhost:7474/db/data/ext",
  "relationship_types" : "http://localhost:7474/db/data/relationship/types",
  "batch" : "http://localhost:7474/db/data/batch",
  "cypher" : "http://localhost:7474/db/data/cypher",
  "indexes" : "http://localhost:7474/db/data/schema/index",
  "constraints" : "http://localhost:7474/db/data/schema/constraint",
  "transaction" : "http://localhost:7474/db/data/transaction",
  "node_labels" : "http://localhost:7474/db/data/labels",
  "neo4j_version" : "3.0.4"
}
pmackay commented 7 years ago

I am also seeing this using neo4jrb_spatial gem (which is heavily based on neography implementation, so perhaps the cause is the same).