search for: ferret_create

Displaying 20 results from an estimated 26 matches for "ferret_create".

2006 Jul 07
0
acts_as_ferret transactions
...,8 @@ module InstanceMethods attr_reader :reindex - @ferret_reindex = true + @ferret_reindex = false + @defer_for_transaction = false def ferret_before_update @ferret_reindex = true @@ -505,9 +506,13 @@ # add to index def ferret_create - logger.debug "ferret_create/update: #{self.class.name} : #{self.id}" - self.class.ferret_index << self.to_doc if @ferret_reindex - @ferret_reindex = true + unless @defer_for_transaction + logger.debug "ferret_create/update: #{se...
2006 Oct 31
2
corrupted index preventing save
Hi, I''m using Rails/AAF with Ferret 0.10.11, and my index occasionally (every few weeks, roughly) becomes corrupted. If the index is busted, until I rebuild it our users are unable to save anything. I get errors like the one below, and the save rolls back. My question is, is there any way to catch the error, and continue with the save even if the model isn''t indexed? What
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
2006 Nov 28
4
Update/Create record only if field is true
I have a sellable flag in my database. I''m trying to have ferret only add/update records where sellable == true. What is the best way to do this? I''ve tried editing instance_methods.rb in the AAF, but I still can''t get it to work. Thanks for the help -- Posted via http://www.ruby-forum.com/.
2005 Dec 02
43
ANN: acts_as_ferret
...oked module MacroMethods 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"...
2005 Dec 02
43
ANN: acts_as_ferret
...oked module MacroMethods 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"...
2007 Oct 01
2
FileNotFoundError
...et-0.11.4/lib/ferret/index.rb:8:in `synchrolock'' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:267: in `<<'' /vendor/plugins/acts_as_ferret/lib/local_index.rb:152:in `<<'' /vendor/plugins/acts_as_ferret/lib/instance_methods.rb:73:in `ferret_create'' Thanks. Morten
2006 Jun 01
1
Using acts_as_ferret outside rails
...ng this to the top of my model: require "#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb" and then defining RAILS_ROOT and RAILS_ENV in my app that uses the model outside rails. That got me this exception: ../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:465:in `ferret_create'': undefined method `debug'' for nil:NilClass (NoMethodError) Anyone know what''s the correct way to do this? Thanks, Pedro.
2008 Jan 04
0
Records not in search results until I recreate record index
...a has_many relationship so our api accepts a title and a list of sites creates object A with object = Object.new object.title = thetitle sites = Site.find_all_by_whatever([whatever]) object.save object.sites << sites Then because sites were added after the object was created we do object.ferret_create If we do Object.find_by_contents(''title:thetitle AND site_search:sitecode'') we get nothing If we do Object.find_by_contents(''title:thetitle'') we get the record and if we do Object.find_by_contents(''title:thetitle'').first.to_doc the site_sear...
2006 Aug 26
7
Erratic behavior with ferret 0.95 and acts_as_ferret
I am getting this issue also... Does anyone know what this is? When will Acts as Ferret be available for v10? Thanks for your help in desperation! Caspar wrote: > Okay previous post related to me trying to fix this problem with an > upgrade to ferret 0.10.0 but acts as ferret is obviously not compatible > with this new version of ferret. > My app is about to go into production and
2006 Jun 29
2
Possibly same issue as ''duplicate search results'' topic?
...xin 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-forum.com/.
2007 Nov 11
5
undefined method `add''
...071111152414/vendor/plugins/acts_as_ferret/lib/ferret_server.rb:71:in `method_missing'' /data/releases/20071111152414/vendor/plugins/acts_as_ferret/lib/remote_index.rb:31:in `<<'' /data/releases/20071111152414/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:73:in `ferret_create'' I''m running the latest stable version of AAF. Any tips or work arounds much appreciated. Morten
2006 Jun 17
2
preventing indexing of an acts_as_ferret''d model?
Hi, this is hopefully an easy one, but I''ve gone through the api and searched past forum entries, and am drawing a blank. I have a model that with acts_as_ferret mixed in to it, which is working fine. But I want users to be able to set a ''private'' attribute on the model, and when it''s set to true, create and update methods would skip indexing. So, how can I
2006 Aug 24
5
[0.10.0 - acts_as_ferret] Problem while saving new items
...to apply acts_as_ferret to apply search to my Person model: class Person < ActiveRecord::Base validates_presence_of :name, :surname acts_as_ferret :fields => [ ''name'', ''surname'' ] ... But when I try to save a new Person instance I get this error: ferret_create/update: Person : 20 creating doc for class: Person, id: 20 Adding field name with value ''Paul'' to index Adding field surname with value ''Smith'' to index [4;36;1mSQL (0.000755) [0;1mROLLBACK NoMethodError (You have a nil object when you didn''t expec...
2007 Nov 11
6
Reducing dependency on remote ferret process
Hi. We use FerretDrb for search. If the ferret process is down, our entire application comes down the moment we try to save a model which is indexed. Is there a way to decouple this relationship such that we can somehow resume normal operations despite ferret being down and not index the model? Thanks. Morten
2006 Dec 15
1
Ferret debugging
Is there any way to debug processes of creating/updating of index and data retrieval? I use ferret (0.10.13) and acts_as_ferret plugin, and it seems that index is being updated - field ''state_or_province_or_region'' has value ''ON'': ferret_create/update: Entity : 1 creating doc for class: Entity, id: 1 Adding field description with value ''Sed metus lorem, pellentesque ac, dignissim mattis, pellentesque sit amet, est. Aliquam id urna non lorem convallis ornare'' to index Adding field name with value ''Sed sodales'...
2006 Oct 19
0
wrong indexing when I use disable ferret and ferret update i
I am using acts_as_ferret plugin. ITs working great on my local but when i put it on my textdrive server indexing is not proper. If I delete the indexes created, and search then the new set of indexes seem to work fine. But when I use ferret_create(I have do so for a new entery in my db), the whole indexing thing goes wrong. I get wrong results. Is this due to character encoding? Thanks Aditya -- Posted via http://www.ruby-forum.com/.
2006 Nov 06
21
acts_as_ferret and associations
I have the following models: class Book < ActiveRecord::Base acts_as_ferret belongs_to :author end class Author < ActiveRecord::Base has_many :books end and in the controller: def search if params[:query] @query = params[:query] @total, @books = Book.full_text_search(@query, :page => (params[:page]||1)) @pages =
2007 Aug 30
0
Method missing error after switching to DRB
...uby://localhost:9010) /var/lib/gems/1.8/gems/acts_as_ferret-0.4.1/lib/ferret_server.rb:62:in `method_missing'' /var/lib/gems/1.8/gems/acts_as_ferret-0.4.1/lib/remote_index.rb:31:in `<<'' /var/lib/gems/1.8/gems/acts_as_ferret-0.4.1/lib/instance_methods.rb:73:in `ferret_create'' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `send'' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `callback'' /var/lib/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callba...
2006 Aug 01
8
Problem importing lots of records
.../acts_as_ferret/lib/acts_as_ferret.rb:510:in `<<'': : Error occured at <index_rw.c>:703 (StandardError) Error: exception 6 not handled: Could not obtain write lock when trying to write index from ./imports/../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:510:in `ferret_create'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/callbacks.rb:333:in `callback'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/callbacks.rb:330:in `callback'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_...