Strange behavior after switching to DRb server


#1

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:

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:inload’
(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:inload’
(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:inrecv_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:ininit_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:inperform’
(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:inmain_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:inrun’
(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:ininitialize’
(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:instart’
(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:infind_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:inar_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:infind_by_contents’
app/models/resource.rb:126:in search' app/controllers/resource_search_controller.rb:68:inindex’


#2

On Sun, Apr 01, 2007 at 07:32:35PM -0400, John B. 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::SCORE

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 == ‘’

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
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa


#3

On Apr 2, 2007, at 6:16 AM, Jens K. 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 == ‘’

before line 142 in acts_as_ferret.rb should resolve the issue. Or get
the latest aaf from trunk.

Great, thanks Jens.