pangloss / pacer-neo4j

Neo4J adapter for Pacer
http://neo4j.org
20 stars 4 forks source link

Lucene ParseException #6

Open tazsingh opened 12 years ago

tazsingh commented 12 years ago

Hi,

I'm noticing a Lucene ParseException when I try to query against a key while using unescaped strings.

I've replicated it with the following:

require "pacer"
require "pacer-neo4j"

graph = Pacer.neo4j "temp"

graph.create_key_index "type", :vertex

graph.create_vertex type: "Some::Class"

# This raises a lucene ParseException error
graph.v(type: "Some::Class").first

# This would also raise the same error
graph.v(type: -1).first

I've noticed that this bug may be fixed by this commit: 85501ede7d7c8bf62b131d56431ad6ed51b33af9 However when I ask Bundler to use this repo, it complains with:

> bundle update
Updating git://github.com/pangloss/pacer-neo4j.git
Fetching gem metadata from https://rubygems.org/...
Using pacer (1.1.1) 
Using pacer-neo4j (2.1.0) from git://github.com/pangloss/pacer-neo4j.git (at master) 
pacer-neo4j at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/bundler/gems/pacer-neo4j-b2509dc7cf99 did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
  ["lib/pacer-neo4j-2.1.0-standalone.jar"] are not files

Using bundler (1.2.1) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

And running the above code (with a require "bundler"; Bundler.require instead of the first 2 lines) gives me the following:

> jruby -S lucene_index_bug.rb 
LoadError: no such file to load -- pacer-neo4j-2.1.0-standalone
  require at org/jruby/RubyKernel.java:1019
   (root) at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/bundler/gems/pacer-neo4j-b2509dc7cf99/lib/pacer-neo4j.rb:8
  require at org/jruby/RubyKernel.java:1019
   (root) at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:1
     each at org/jruby/RubyArray.java:1612
  require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:68
     each at org/jruby/RubyArray.java:1612
  require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:66
  require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:55
   (root) at lucene_index_bug.rb:2

Let me know if you need anything else. Thanks.

pangloss commented 12 years ago

You can't use pacer or pacer-neo4j as git dependencies in bundler because they need to build their jars. What I do is check them out in a sibling dir, build the jars and then use path: '../pacer-neo4j' style bundler dependencies.

If you know how to trigger that build for a bundler dependency, let me know!

in pacer: rake jar in pacer-neo4j: rake build

On Tue, Nov 20, 2012 at 11:27 AM, Tasveer Singh notifications@github.comwrote:

Hi,

I'm noticing a Lucene ParseException when I try to query against a key while using unescaped strings.

I've replicated it with the following:

require "pacer" require "pacer-neo4j"

graph = Pacer.neo4j "temp"

graph.create_key_index "type", :vertex

graph.create_vertex type: "Some::Class"

This raises a lucene ParseException error

graph.v(type: "Some::Class").first

This would also raise the same error

graph.v(type: -1).first

I've noticed that this bug may be fixed by this commit: 85501edhttps://github.com/pangloss/pacer-neo4j/commit/85501ede7d7c8bf62b131d56431ad6ed51b33af9 However when I ask Bundler to use this repo, it complains with:

bundle update Updating git://github.com/pangloss/pacer-neo4j.git Fetching gem metadata from https://rubygems.org/... Using pacer (1.1.1) Using pacer-neo4j (2.1.0) from git://github.com/pangloss/pacer-neo4j.git (at master) pacer-neo4j at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/bundler/gems/pacer-neo4j-b2509dc7cf99 did not have a valid gemspec. This prevents bundler from installing bins or native extensions, but that may not affect its functionality. The validation message from Rubygems was: ["lib/pacer-neo4j-2.1.0-standalone.jar"] are not files

Using bundler (1.2.1) Your bundle is updated! Use bundle show [gemname] to see where a bundled gem is installed.

And running the above code (with a require "bundler"; Bundler.requireinstead of the first 2 lines) gives me the following:

jruby -S lucene_index_bug.rb LoadError: no such file to load -- pacer-neo4j-2.1.0-standalone require at org/jruby/RubyKernel.java:1019 (root) at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/bundler/gems/pacer-neo4j-b2509dc7cf99/lib/pacer-neo4j.rb:8 require at org/jruby/RubyKernel.java:1019 (root) at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:1 each at org/jruby/RubyArray.java:1612 require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:68 each at org/jruby/RubyArray.java:1612 require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:66 require at /Users/tsingh/.rbenv/versions/jruby-1.7.0/lib/ruby/gems/shared/gems/bundler-1.2.1/lib/bundler/runtime.rb:55 (root) at lucene_index_bug.rb:2

Let me know if you need anything else. Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/pangloss/pacer-neo4j/issues/6.