I noticed that the :single_index option is no longer listed in the documentation for AAF, specifically in lib/acts_methods.rb [1] Furthermore, after an upgrade from a rather old version of AAF, I notice that the index (after reindexing) is no longer in RAILS_ROOT/index/RAILS_ENV/shared, but instead split out into separate directories for each model. What changed? Thanks, -chris [1] Notice it's still listed as an option here: http://actsasferret.rubyforge.org/classes/ActsAsFe... but not at http://projects.jkraemer.net/acts_as_ferret/browse...
on 2008-10-10 20:34
on 2008-10-13 18:15
Hi! On 10.10.2008, at 20:34, Chris G. wrote: > I noticed that the :single_index option is no longer listed in the > documentation for AAF, specifically in lib/acts_methods.rb [1] > > Furthermore, after an upgrade from a rather old version of AAF, I > notice > that the index (after reindexing) is no longer in > RAILS_ROOT/index/RAILS_ENV/shared, but instead split out into separate > directories for each model. What changed? :single_index isn't supported any more. With current trunk the preferred way to declare an index is via the ActsAsFerret::define_index method, in a file called config/aaf.rb. There you may declare several classes using the same index like this: ActsAsFerret.define_index('my_index', :models => { OneModel => { :fields => { :title => { :boost => 2 }, :description => { } }, :if => Proc.new { |r| r.published? } }, AnotherModel => { :fields => { :title => { :boost => 2 }, :another_field => {}, }, :if => Proc.new { |r| r.should_index? } }, :ferret => { :default_field => %w( title description another_field ) }) No need to call acts_as_ferret inside your model anymore (though it will still work for the one index per class scenario). my_index is the name of the index, to be used with ActsAsFerret::find: ActsAsFerret::find("some query", 'my_index') to only search records of a given class, find_with_ferret works as expected: OneModel.find_with_ferret('some query') Sorry for not documenting this stuff better... cheers, Jens -- Jens Krämer webit! Gesellschaft für neue Medien mbH Schnorrstraße 76 | 01069 Dresden Telefon +49351467660 | Telefax +493514676666 kraemer@webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold
on 2008-10-13 22:19
Thanks for the update, Jens. Unfortunately, it looks like I'll have to stick with the stable branch for now - these changes in trunk don't jive well with my apps. Thanks and keep up the great work! -chris
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.