Displaying 20 results from an estimated 28 matches for "ferret_upd".
2007 Feb 01
4
Automatically Indexing Associated Models
PROBLEM
I have two models, Blog and BlogComment. When a blog is initially
created, it has no comments. Upon creation, the title and body are
automatically added to the ferret index and directly searchable.
However, when a comment is added to a blog, that comment does not get
added to the index and is therefore not ferretable. The desired behavior
is that when a comment is added to a blog, that the
2009 Mar 18
0
Acts_as_ferret: Slow ferret_update with associated models
Hi,
I am using some custom fields for ferret indexing to include fields from
associated models. When those child models are updated, I do
ferret_update
on the parent model. Unfortunately, that takes very long, depending on
the
number of associated child models. That is because every child model is
called to re-index the parent, instead of just the changed one.
What can I do to speed up re-indexing?
I am using Rails 2.1.2, Ferret 0.11.6 and Act...
2006 Nov 28
17
Index not being updated
My index is not being updated when I add new records or amend existing
ones.
Can anyone point me in the direction of where I should be looking for
what is going wrong?
I''m running this in the production environment.
--
Posted via http://www.ruby-forum.com/.
2006 Sep 18
3
Automatic reindexing of associated columns acts_as_taggable
Hi,
So i''m trying to use acts_as_taggable with the acts_as_ferret plugin,
where I have Post.rb model, which has a method tag_list made available
through acts_as_taggable, as returns a string of associated tag words
from the tags table (tag.rb). I''ve set up my Post.rb model in the
following way.
class Post < ActiveRecord::Base
acts_as_taggable
acts_as_ferret
2007 Apr 05
2
best way to maintain dynamic fields?
...lt << " "
result << each.subject
result << " "
result << each.body
end
end
result
end
end
class Comment < ActiveRecord::Base
belongs_to :commentable, :polymorphic => true
def after_create
commentable.ferret_update
end
def after_update
commentable.ferret_update
end
def after_destroy
commentable.ferret_update
end
end
--
Posted via http://www.ruby-forum.com/.
2006 Aug 25
7
disabling automatic indexing in acts_as_ferret
I''d like to be able to enable/disable the automatic indexing of
documents acts_as_ferret does. Something like MyModel.disable_indexing
MyModel.enable_indexing would be perfect. I need this because I do some
indexing that requires visiting the parents of the model objects and my
import method imports the children first, so the information isn''t there
yet. I''d like to
2007 Aug 06
4
acts_as_ferret cross model index not updating
Does anyone know how do you get acts_as_ferret to automagically update
non-standard fields?
I''ve followed Rails Envy''s tutorial
(http://www.railsenvy.com/2007/2/19/acts-as-ferret-tutorial#nonmodel) to
get aaf working across different models. And once the index is built it
searches fine.
In my (main) model, I''ve put:
acts_as_ferret :fields => [ :name,
2006 Jun 29
2
Possibly same issue as ''duplicate search results'' topic?
...l to add the mixin to the model class looks like this:
acts_as_ferret :store_class_name => true, :fields => [''id'', ''code'',
''description'']
As a test (and a workaround), in acts_as_ferret.rb module
InstanceMethods, I replaced:
alias :ferret_update :ferret_create
with:
def ferret_update
self.ferret_destroy
self.ferret_create
end
This ensures unique indexes for me. But I''m guessing it''s redundant and
something else is not used or working as intended.
Thanks for reading,
Neil
--
Posted via http://www.ruby-...
2006 Dec 11
1
Index help on Polymorphic Associations
Hello,
I''m a newbie to aaf and rails and I hope anyone can help me with this.
I have the following Models:
class Project < ActiveRecord::Base
acts_as_authorizable
acts_as_audited :except => [:created_by, :updated_by ],
:user_class_name => ''AuthenticatedSystem'', :user_method =>
''current_user''
acts_as_ferret :fields => {:name =>
2006 May 10
1
acts_as_ferret choking
...9;
> /opt/local/lib/ruby/1.8/monitor.rb:229:in `synchronize''
> /opt/local/lib/ruby/gems/1.8/gems/ferret-0.9.1/lib/ferret/index/
> index.rb:258:in `<<''
> /Users/sk/Documents/svn/cms/branches/nodes/vendor/plugins/
> acts_as_ferret/lib/acts_as_ferret.rb:407:in `ferret_update''
> (...)
The problem seems to be caused by the following code in acts_as_ferret:
@sub_readers.each { |r| return false unless r.latest? }
which, in turn, causes a NoMethodError because @segment_infos is nil.
The problem (or, at least, the symptom) goes away when I add a rescue...
2005 Dec 02
43
ANN: acts_as_ferret
...def acts_as_ferret
extend FerretMixin::Acts::ARFerret::ClassMethods
class_eval do
include FerretMixin::Acts::ARFerret::ClassMethods
after_create :ferret_create
after_update :ferret_update
after_destroy :ferret_destroy
end
end
end
module ClassMethods
include Ferret
INDEX_DIR = "#{RAILS_ROOT}/db/index.db"
def self.reloadable?...
2005 Dec 02
43
ANN: acts_as_ferret
...def acts_as_ferret
extend FerretMixin::Acts::ARFerret::ClassMethods
class_eval do
include FerretMixin::Acts::ARFerret::ClassMethods
after_create :ferret_create
after_update :ferret_update
after_destroy :ferret_destroy
end
end
end
module ClassMethods
include Ferret
INDEX_DIR = "#{RAILS_ROOT}/db/index.db"
def self.reloadable?...
2007 May 25
1
how to update index with acts_as_ferret?
Hey all,
I have movie has_many :medias and media belongs_to :media
this is how my movie class looks like:
class Movie < ActiveRecord::Base
has_many :medias
acts_as_ferret :fields => [:title,:medias_name]
def medias_name
return self.medias.inject("") {|name,m| name + " " + m.name}
end
end
when I do Movie.find_by_contents("title:bob") it does return a movie
2007 Apr 10
1
disable indexing for an object
Hi,
I have a project where the user adds content to the database, but before
it''s indexed they have to confirm it via email.
How can I disable indexing for just one particular object, and then
after confirmation let ferret know about it?
- Radu
--
Posted via http://www.ruby-forum.com/.
2007 Jan 18
1
Updating index when non-rails app creates entries?
I have a database shared between a Rails app (gui) and a Java app
(daemon). When the java app periodically updates the database, this
isn''t reflected in Ferret indexes visible via acts_as_ferret in Rails.
How do I trigger re-indexing? Do I just make my Java daemon delete the
index files, or is there something cleverer than that..?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Jul 07
0
acts_as_ferret transactions
...d}"
+ self.class.ferret_index << self.to_doc if @ferret_reindex
+ @ferret_reindex = true
+ else
+ logger.debug "deferred ferret_create/update:
#{self.class.name} : #{self.id}"
+ end
true
end
alias :ferret_update :ferret_create
@@ -522,6 +527,21 @@
end
true
end
+
+ def at_start_transaction(name = nil)
+ @defer_for_transaction = true
+ end
+
+ def at_abort_transaction(name = nil)
+ @defer_for_transaction = false
+ @ferret_reind...
2007 Jan 23
2
making acts_as_ferret thread safe?
...or/plugins/acts_as_ferret/lib/class_methods.rb:240:in
`create_index_instance''
from
./script/../config/../vendor/plugins/acts_as_ferret/lib/class_methods.rb:232:in
`ferret_index''
from
./script/../config/../vendor/plugins/acts_as_ferret/lib/instance_methods.rb:88:in
`ferret_update''
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:344:in
`callback''
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:341:in
`callback''
... 16 levels...
from
/usr/lib/...
2006 Nov 20
0
End-of-File Error occured at <except.c>:79 in xraise
...39;
/usr/local/lib/ruby/site_ruby/1.8/ferret/index.rb:280:in `<<''
/usr/local/lib/ruby/1.8/monitor.rb:229:in `synchronize''
/usr/local/lib/ruby/site_ruby/1.8/ferret/index.rb:252:in `<<''
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:85:in
`ferret_update''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:344:in
`callback''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:341:in
`callback''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-
1.14.4/lib/...
2007 Jul 24
1
Why can''t find index file sometimes?
...et/index.rb:8:in
`synchrolock''
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:267:in
`<<''
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/local_index.rb:157:in
`<<''
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:73:in
`ferret_update''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:333:in
`send''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:333:in
`callback''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb:330:in
`each''...
2006 Feb 28
14
Multiple Models w/ acts_as_ferret
I have multiple models all with:
acts_as_ferret :fields => [...]
(models = profiles, blogs, comments )
When I restart the server and perform any crud operation on one of the
above models, the index is created/updated. If I then go and perform
any crud operation on ANOTHER model, ...the index from that first model
is being updated.
Any ideas? Can acts_as_ferret handle this?
Thanks