> You'd have to mimic the way how aaf uses the index in your script. the
> to_doc method in instance_methods.rb should be a goot starting point.
>
> It would be way easier to use ActiveRecord in the script and run
> it through script/runner - that way aaf will catch the updates.
Little up :)
Hi !
I have the same problem :
I use a Ruby on rails (Hobo) application with a database filled by
antother ruby script.
I also use acts_as_ferret plugin to offer full text search capability to
my rails application.
This is the indexed model :
============================
class Job < ActiveRecord::Base
acts_as_ferret :additional_fields => [:username, :hostname]
hobo_model
belongs_to :atuser
belongs_to :athost
#--- Used to index atUsers and atHosts ---#
def username
return atuser.name
end
def hostname
return athost.name
end
etc...
end #~ Job
The problem is that the ferret index is not updated when I add/delete
information in my database (because I use an external application
(written in Ruby) to fill my database and I haven't acces save/destroy
rails model functions (overloaded by the acts_as_ferret plugin...))
---------
I thought to 2 solutions :
- WebService (WSDL) that give me acces to save/destroy function of my
rails app
- Update Ferret index "On the fly" when inserting new values in
database.
----------
I prefer the second solution because the first risks to be too slow, and
I need rapidity.
Finaly, the question is : How can I update a Ferret index out of my
rails application ?
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk