Charlie
2006-Jun-25 17:37 UTC
[Ferret-talk] acts_as_ferret with existing data (Building an index?)
Hi, I''m trying to get the acts_as_ferret plugin to work with my rails application, but it barfs with this error: No such file or directory - ./index/development/Book/segments I have existing data in my database, but it was added prior to me using the ferret plugin. How do I get it to index that data, or when does it index that data? Charlie -- Posted via http://www.ruby-forum.com/.
Jan Prill
2006-Jun-27 06:04 UTC
[Ferret-talk] acts_as_ferret with existing data (Building an index?)
Hi Charlie, the most simple method for doing this should be the rebuild_index() method of acts_as_ferret. From the API docs (http://projects.jkraemer.net/acts_as_ferret/rdoc/ ): rebuild_index() <http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000007> rebuild the index from all data stored for this model. This is called automatically when no index exists yet. TODO: the automatic index initialization only works if every model class has it''s own index, otherwise the index will get populated only with instances from the first model loaded If this isn''t working for you, you might (as it seems) 1. Post a ticket to acts_as_ferret trac 2. Write some code to build up an initial index yourself: Therefore you only need to find :all models you want to index, iterate over them and index them - calling save on them to trigger acts_as_ferret or bypassing acts_as_ferret by using ferret directly as described in http://ferret.davebalmain.com/trac, beginning with http://ferret.davebalmain.com/api/files/TUTORIAL.html Cheers, Jan> > > > On 6/25/06, Charlie <charlie.hubbard at gmail.com> wrote: > > > > Hi, > > > > I''m trying to get the acts_as_ferret plugin to work with my rails > > application, but it barfs with this error: > > > > No such file or directory - ./index/development/Book/segments > > > > I have existing data in my database, but it was added prior to me using > > the ferret plugin. How do I get it to index that data, or when does it > > index that data? > > > > Charlie > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Ferret-talk mailing list > > Ferret-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ferret-talk > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20060627/56a84994/attachment.html