Hi Winton,

that's right. find_by_content finds a ferret document. From that document the mysql-id gets extracted and then ActiveRecord gets the model from the db. Using ferret fulltext-searches are a magnitude faster than searching on an innodb with LIKE if there are many records on your db and you'll get the ferret query language for your convenience.

If you don't want to rely on the db at all you need to work with the ferret documents directly. That's possible as well.

Cheers,
Jan

On 8/2/06, Winton <[EMAIL PROTECTED]> wrote:
When calling a Result.find_by_content on my model, I get the following
error:

Mysql::Error: Table 'db.results' doesn't exist: SHOW FIELDS FROM results

Yes, I remembered to put acts_as_ferret. Any ideas?



Trace:
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
`log'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord- 1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:185:in
`execute'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:293:in
`columns'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:696:in
`columns'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord- 1.14.2/lib/active_record/calculations.rb:213:in
`column_for'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:135:in
`calculate'
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/calculations.rb:64:in
`count'
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:249:in
`rebuild_index'

--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to