Jens Kraemer wrote:
> Hi!
>
> On Wed, Sep 19, 2007 at 03:39:14PM +0200, Matt Valblade wrote:
> [..]
>> - WebService (WSDL) that give me acces to save/destroy function of my
>> rails application ?
> The safest way would be to talk to Ferret's DRb server. If you don't do
> any updates to the index at all through your web app, you might also
> just use plain Ferret to update the index.
>
> Code for adding a record to the index via DRb might look like this:
>
> server = DRbObject.new(nil, 'druby://localhost:9010')
> server << record.class.name, record.to_ferret_doc
>
> Aaf adds it's own to_doc method to your AR model, but since you don't
> use AR in your external script, you'll have to implement your own - see
> instance_methods.rb for how aaf does this.
Hi, thanks for your answer !
I'm sorry, but don't understand why I should connect to this server.
The only thing I want to do is to update my index while filling the
database with my script :
this is the aaf field list: [:username, :athost_id, :atuser_id, :date,
:hostname, :url]
I have the username, the date, the hostname and the url.
I can get the athost_id and atuser_id using a SELECT.
why can't I just connect to the aff generated index and update it using
ferret itself :
# Index already generated by acts_as_ferret (with testing info)
index = Index::Index.new(:path => 'index')
index.search_each("*") do |id, score|
puts "Document #{id} found with a score of #{score}"
end
#==> puts nothing !
I use the default aff index dir :
(From act_methods.rb)
:index_dir => "#{ActsAsFerret::index_dir}/#{self.name.underscore}",
I tryed to connect to
index = Index::Index.new(:path => 'index/development/job')
But it doesn't work anymore :(
Thanks for your help.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk