#153 ✓resolved
Leo Lou

Full text search returns nil in rails model

Reported by Leo Lou | February 27th, 2011 @ 02:12 AM | in 1.1.0

$ ruby -v jruby 1.6.0.RC2 (ruby 1.8.7 patchlevel 330) (2011-02-09 5434c72) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [darwin-x86_64-java]

$ gem list | grep neo4j neo4j (1.0.0.beta.31 java)

jruby-1.6.0.RC2 :001 > require 'rubygems'
=> true jruby-1.6.0.RC2 :002 > require 'neo4j'
=> true jruby-1.6.0.RC2 :003 >
jruby-1.6.0.RC2 :004 > class Place < Neo4j::Rails::Model
jruby-1.6.0.RC2 :005?> property :name
jruby-1.6.0.RC2 :006?> index :name, :type => :fulltext
jruby-1.6.0.RC2 :007?> end
=> :fulltext jruby-1.6.0.RC2 :008 >
jruby-1.6.0.RC2 :009 > place = Place.create!(:name => "Test Full Text Search")
I, [2011-02-27T09:11:36.248000 #15364] INFO -- : Enable remote shell at port port=9332
I, [2011-02-27T09:11:36.303000 #15364] INFO -- : Starting local Neo4j using db /Users/Leo/tmp/neo4j/spec/index/db
=> #<Place:0x7a9d1714 @errors=#, @changed_attributes={}, @java_node=#<#<Class:0x15ffdfb42>:0x22b3ea59>, @properties={"name"=>"Test Full Text Search", "classname"=>"Place"}, @relationships={}, @previously_changed={"name"=>[nil, "Test Full Text Search"], "classname"=>[nil, "Place"]}, @validation_context=nil> jruby-1.6.0.RC2 :010 >
jruby-1.6.0.RC2 :011 > Place.find(:name => "Test")
=> nil jruby-1.6.0.RC2 :012 >
jruby-1.6.0.RC2 :013 > Neo4j::Transaction.run do
jruby-1.6.0.RC2 :014 > place.add_index(:name)
jruby-1.6.0.RC2 :015?> end
=> [#<Neo4j::Index::Indexer:0xeca4aae @field_types={}, @indexer_for=Neo4j::Rails::Model, @entity_type=:node, @via_relationships={}, @indexes={}, @parent_indexers=[]>] jruby-1.6.0.RC2 :016 >
jruby-1.6.0.RC2 :017 > Place.find(:name => "Test")
=> nil jruby-1.6.0.RC2 :018 > place
=> #<Place:0x7a9d1714 @errors=#, @changed_attributes={}, @
java_node=#<#<Class:0x15ffdfb42>:0x22b3ea59>, @properties={"name"=>"Test Full Text Search", "classname"=>"Place"}, @relationships={}, @previously_changed={"name"=>[nil, "Test Full Text Search"], "classname"=>[nil, "Place"]}, @validation_context=nil>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket

Attachments

Pages