Brandon Kelly
2007-Sep-07 18:18 UTC
[Ferret-talk] Ferret DRB - can add/edit index, but can''t search
I''m trying to use the Ferret DRB server to avoid concurrency issues when using multiple mongrels. I can successfully add and edit data on my index via the DRB server, however, when I search the index, I get the following error: DRb::DRbConnError (DRb::DRbServerNotFound): /usr/lib/ruby/1.8/drb/drb.rb:1647:in `current_server'' /usr/lib/ruby/1.8/drb/drb.rb:1709:in `to_id'' /usr/lib/ruby/1.8/drb/drb.rb:1045:in `initialize'' /usr/lib/ruby/1.8/drb/drb.rb:639:in `make_proxy'' /usr/lib/ruby/1.8/drb/drb.rb:556:in `dump'' /usr/lib/ruby/1.8/drb/drb.rb:600:in `send_request'' /usr/lib/ruby/1.8/drb/drb.rb:599:in `send_request'' /usr/lib/ruby/1.8/drb/drb.rb:903:in `send_request'' /usr/lib/ruby/1.8/drb/drb.rb:1191:in `send_message'' /usr/lib/ruby/1.8/drb/drb.rb:1083:in `method_missing'' /usr/lib/ruby/1.8/drb/drb.rb:1167:in `open'' /usr/lib/ruby/1.8/drb/drb.rb:1082:in `method_missing'' /usr/lib/ruby/1.8/drb/drb.rb:1100:in `with_friend'' /usr/lib/ruby/1.8/drb/drb.rb:1081:in `method_missing'' /vendor/plugins/acts_as_ferret/lib/remote_index.rb:20:in `find_id_by_contents'' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:120:in `find_id_by_contents'' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:176:in `ar_find_by_contents'' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:170:in `find_records_lazy_or_not'' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:86:in `find_by_contents'' /app/models/article.rb:104:in `full_text_search'' /app/controllers/search_controller.rb:93:in `index'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in `call_filter'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in `process'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in `process'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in `process_client'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `process_client'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run'' /usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/bin/mongrel_rails:16 ----------------- When I''m adding/editing data in the index, my ferret_server.log file shows the following: #method_missing(:add, ["Article", {:synopsis=>"Analysis and Projections", :status=>1, :player_names=>"", :team_names=>"", :publisher=>"", :title=>"Article Title", :db_state=>0, :id=>1, :article_published_date=>1189115220}]) #method_missing(:add, ["Article", {:synopsis=>"Analysis and Projections", :status=>1, :player_names=>"", :team_names=>"", :publisher=>"", :title=>"Article Title 1", :db_state=>0, :id=>1, :article_published_date=>1189115220}]) #method_missing(:add, ["Player", {:last_name=>"Smith", :first_name=>"Walter", :db_state=>0, :id=>1}]) #method_missing(:add, ["Team", {:name=>"Kalispell HS", :db_state=>0, :id=>13}]) ----------------- I''m running the following environment: Linux version 2.6.16.29-xen_3.0.3.0 mongrel (1.0.1) mongrel_cluster (1.0.2, 0.2.1) ferret (0.11.4) acts_as_ferret stable plugin (as of 9/7/2007) I have no problem running this application on my local development environment... and I had no problems running in this hosting environment before I started using Ferret DRB. Here are some example sorts and/or filters I''m using in my searches (not sure if this matters to Ferret DRB or not): Ferret::Search::SortField.new(:article_published_date, :reverse => true) Ferret::Search::Sort.new([Ferret::Search::SortField::SCORE, date_sort]) Ferret::Search::RangeQuery.new(:article_published_date, :>= => UserSystem::APP_DEFAULTS[:days_for_new].days.ago.utc.to_i.to_s, :<= => Time.now.utc.to_i.to_s) Ferret::Search::Sort.new([Ferret::Search::SortField.new(:article_published_date, :reverse => true)]) Any ideas why my searches wouldn''t be working? -- Posted via http://www.ruby-forum.com/.
Brandon Kelly
2007-Sep-08 13:44 UTC
[Ferret-talk] Ferret DRB - can add/edit index, but can''t search
I wanted to note the Ruby and Rails versions that I''m running, in case that helps.> Linux version 2.6.16.29-xen_3.0.3.0+ Ruby 1.8.4 (2005-12-24 [i386-linux] + Rails 1.2.3> mongrel (1.0.1) > mongrel_cluster (1.0.2, 0.2.1) > ferret (0.11.4) > acts_as_ferret stable plugin (as of 9/7/2007)-- Posted via http://www.ruby-forum.com/.
Jens Kraemer
2007-Sep-09 10:43 UTC
[Ferret-talk] Ferret DRB - can add/edit index, but can''t search
Hi Brandon, transmitting objects from Ferret''s API across the DRb connection is always a bit tricky. If these don''t serialize correctly, DRb only transmits a stub and then tries to talk back to the original object via a DRb connection from the server to your web server process, which results in the message you see. Sort and SortFields should work, but I''m not sure if I introducted the one or the other after the 0.4.1 release. Imho, Sort objects can simply be replaced by an array holding the SortFields. For the RangeQueries and other query objects that fail the way you describe, please try using FQL instead to see if this fixes the problem. cheers, Jens On Fri, Sep 07, 2007 at 08:18:52PM +0200, Brandon Kelly wrote:> I''m trying to use the Ferret DRB server to avoid concurrency issues when > using multiple mongrels. I can successfully add and edit data on my > index via the DRB server, however, when I search the index, I get the > following error: > > DRb::DRbConnError (DRb::DRbServerNotFound): > /usr/lib/ruby/1.8/drb/drb.rb:1647:in `current_server''[..]> ----------------- > > I''m running the following environment: > > Linux version 2.6.16.29-xen_3.0.3.0 > mongrel (1.0.1) > mongrel_cluster (1.0.2, 0.2.1) > ferret (0.11.4) > acts_as_ferret stable plugin (as of 9/7/2007) > > > I have no problem running this application on my local development > environment... and I had no problems running in this hosting environment > before I started using Ferret DRB. > > Here are some example sorts and/or filters I''m using in my searches (not > sure if this matters to Ferret DRB or not): > > Ferret::Search::SortField.new(:article_published_date, :reverse => true) > > Ferret::Search::Sort.new([Ferret::Search::SortField::SCORE, date_sort]) > > Ferret::Search::RangeQuery.new(:article_published_date, :>= => > UserSystem::APP_DEFAULTS[:days_for_new].days.ago.utc.to_i.to_s, :<= => > Time.now.utc.to_i.to_s) > > Ferret::Search::Sort.new([Ferret::Search::SortField.new(:article_published_date, > :reverse => true)]) > > > Any ideas why my searches wouldn''t be working? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database
Brandon Kelly
2007-Sep-10 03:13 UTC
[Ferret-talk] Ferret DRB - can add/edit index, but can''t search
Jens, Thanks for your help. I ripped out the Sort, SortField and RangeQuery objects, and sure enough - it worked. I''ll try your suggestions tomorrow -- using the sort fields and FQL. Brandon Jens Kraemer wrote:> Hi Brandon, > > transmitting objects from Ferret''s API across the DRb connection is > always a bit tricky. If these don''t serialize correctly, DRb only > transmits a stub and then tries to talk back to the original object > via a DRb connection from the server to your web server process, which > results in the message you see. > > Sort and SortFields should work, but I''m not sure if I introducted the > one or the other after the 0.4.1 release. Imho, Sort objects can simply > be replaced by an array holding the SortFields. > > For the RangeQueries and other query objects that fail the way you > describe, please try using FQL instead to see if this fixes the problem. > > cheers, > Jens-- Posted via http://www.ruby-forum.com/.
Brandon Kelly
2007-Sep-11 16:01 UTC
[Ferret-talk] Ferret DRB - can add/edit index, but can''t search
Just to close out this thread -- After I converted the Sort, SortFields to :sort = [''field_one DESC'', field_two''] and RangeQueries to FQL - Ferret DRB worked fine. The simpler approach is usually the right approach. Thanks Jens - for your suggestions. - Brandon Brandon Kelly wrote:> Jens, > > Thanks for your help. I ripped out the Sort, SortField and RangeQuery > objects, and sure enough - it worked. I''ll try your suggestions > tomorrow -- using the sort fields and FQL. > > > Brandon >-- Posted via http://www.ruby-forum.com/.