John Bachir
2007-Apr-01 23:32 UTC
[Ferret-talk] strange behavior after switching to DRb server
After switching to the DRb server, I am experiencing strange behavior when sorting on score. My app was working as expected before the switch. Both before and after the switch, my app sorts properly on other fields, such as date. For sorting on score, I am using the following option find_by_contents option: :sort => Ferret::Search::SortField::SCORE Before switching to DRb, this worked very well. Afterward, I see the error below. (Resource is my model). Any ideas? Thanks (again...) John --------------------------- RuntimeError in Resource searchController#index invalid value: <SCORE> RAILS_ROOT: script/../config/.. (druby://localhost:9010) ./vendor/plugins/acts_as_ferret/lib/ acts_as_ferret.rb:142:in `_load'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:582:in `load'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/thread.rb:33:in `exclusive'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:578:in `load'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:616:in `recv_request'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:615:in `recv_request'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:908:in `recv_request'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1527:in `init_with_client'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1539:in `setup_message'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1491:in `perform'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1427:in `run'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1424:in `run'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'' (druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'' (druby://localhost:9010) ./vendor/plugins/acts_as_ferret/lib/ ferret_server.rb:45:in `start'' (druby://localhost:9010) (eval):55 (druby://localhost:9010) script/runner:3:in `eval'' (druby://localhost:9010) ./vendor/rails/railties/lib/commands/ runner.rb:45 (druby://localhost:9010) script/runner:3 vendor/plugins/acts_as_ferret/lib/remote_index.rb:20:in `find_id_by_contents'' vendor/plugins/acts_as_ferret/lib/class_methods.rb:82:in `find_id_by_contents'' vendor/plugins/acts_as_ferret/lib/class_methods.rb:134:in `ar_find_by_contents'' vendor/plugins/acts_as_ferret/lib/class_methods.rb:128:in `find_records_lazy_or_not'' vendor/plugins/acts_as_ferret/lib/class_methods.rb:54:in `find_by_contents'' app/models/resource.rb:126:in `search'' app/controllers/resource_search_controller.rb:68:in `index'' -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20070401/e0a47c23/attachment-0001.html
Jens Kraemer
2007-Apr-02 10:16 UTC
[Ferret-talk] strange behavior after switching to DRb server
On Sun, Apr 01, 2007 at 07:32:35PM -0400, John Bachir wrote:> After switching to the DRb server, I am experiencing strange behavior > when sorting on score. My app was working as expected before the switch. > > Both before and after the switch, my app sorts properly on other > fields, such as date. > > For sorting on score, I am using the following option > find_by_contents option: > > :sort => Ferret::Search::SortField::SCOREI had to build custom marshalling routines to support sort fields and it seems I missed that one. Adding this line: return Ferret::Search::SortField::SCORE if string == ''<SCORE>'' before line 142 in acts_as_ferret.rb should resolve the issue. Or get the latest aaf from trunk. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
John Bachir
2007-Apr-02 18:50 UTC
[Ferret-talk] strange behavior after switching to DRb server
On Apr 2, 2007, at 6:16 AM, Jens Kraemer wrote:> I had to build custom marshalling routines to support sort fields > and it > seems I missed that one. > > Adding this line: > > return Ferret::Search::SortField::SCORE if string == ''<SCORE>'' > > before line 142 in acts_as_ferret.rb should resolve the issue. Or get > the latest aaf from trunk.Great, thanks Jens.