I started using robotcoop's CachedModel class in my project but have
encountered problems when using it with the acts_as_ferret plugin. It seems it
doesn't index everything in my STI model, also if I do a search from my base
STI class I get a result count but no results. If I run the same search from
one of the children STI models I get the appropriate results (if the
information was indexed).
Here's my setup:
class Record < CachedModel
acts_as_nested_set
acts_as_ferret( :fields => {
:lft { :index => :untokenized_omit_norms },
:name => {},
:desc => {},
:body => {:strore => :yes},
:role => {},
})
def self.inheritance_column
'role'
end
# methods below .....
end
class FirstRecord < Record
end
class SecondRecord < Record
end
class ApplicationController < ActionController::Base
after_filter { CachedModel.cache_reset }
end
Here's my CachedModel setup:
- config/environment.rb:
# Include your application configuration below
require 'cached_model'
CachedModel.use_local_cache = true
- config/environments/development.rb (last line)
CACHE = MemCache.new 'localhost:11211', :namespace => 'ohio_development'
- config/environments/production.rb (last line)
CACHE = MemCache.new 'localhost:11211', :namespace => 'ohio_production'
As far as I can tell I've set both up properly. Also I get the same problems
when running in production mode.
This is on a FreeBSD 6.1 server, with memcached-1.1.12_3, mysql 5.0.26, and
rails 1.1.6.
Any help would be appreciated as I've been at this one for 2 days.
Here's example output I get from irb:
>> Record.find_by_contents("search code")
=> #<FerretMixin::Acts::ARFerret::SearchResults:0x8d9f6e0 @total_hits=212,
@reults=[]>
This makes me think it has something to do with the 'find' method being
overridden by CachedModel but not sure how to verify that at this point.
Thanks,
Curtis
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk