Forum: Ferret Strange behavior with acts_as_ferret in dev environment.

Posted by Jeremy Mcnevin (cratchit)
on 2008-02-27 00:28
I'm just wondering if this is expected behavior or not in the dev
environment, and if not, what I could be doing wrong...

I have a Contact model with the following line:

acts_as_ferret :fields => [ :first_name, :middle_name, :last_name ]

Basically, within my controller, the second I initialize my Contact
model in any way, I get this in the acts_as_ferret.log:

[contact] register class Contact with index contact
[contact] ignoring redefinition of ferret field middle_name
[contact] ignoring redefinition of ferret field last_name
[contact] ignoring redefinition of ferret field first_name
[contact] default field list for index contact: [:middle_name,
:last_name, :first_name]

This doesn't happen in script/console.

Also, my development.log gets a HUGE message like this on every
request...

configured index for class Contact:
{:ferret_fields=>{:middle_name=>{:via=>:middle_name,
:term_vector=>:with_positions_offsets, :index=>:yes, :store=>:no,
:highlight=>:yes, :boost=>1.0}, :last_name=>{:via=>:last_name,
:term_vector=>:with_positions_offsets, :index=>:yes, :store=>:no,
:highlight=>:yes, :boost=>1.0}, :first_name=>{:via=>:first_name,
:term_vector=>:with_positions_offsets, :index=>:yes, :store=>:no,
:highlight=>:yes, :boost=>1.0}}, :fields=>[:first_name, :middle_name,
:last_name], :user_default_field=>nil, :enabled=>true,
:index_dir=>"/Users/myname/Sites/hg/dev_ferret/index/development/contact",
:name=>:contact, :mysql_fast_batches=>true, :single_index=>false,
:reindex_batch_size=>1000,
:index_base_dir=>"/Users/myname/Sites/hg/dev_ferret/index/development/contact",
:raise_drb_errors=>false, :registered_models=>[Contact(id: integer,
org_id: integer, user_id: integer, created_at: datetime, updated_at:
datetime, prefix: string, first_name: string, middle_name: string,
last_name: string, suffix: string, company: string, title: string,
primary_address_id: integer, primary_phone_id: integer,
primary_email_id: integer, aux_info: text, cached_tag_list: string),
Contact(id: integer, org_id: integer, user_id: integer, created_at:
datetime, updated_at: datetime, prefix: string, first_name: string,
middle_name: string, last_name: string, suffix: string, company: string,
title: string, primary_address_id: integer, primary_phone_id: integer,
primary_email_id: integer, aux_info: text, cached_tag_list: string),
Contact(id: integer, org_id: integer, user_id: integer, created_at:
datetime, updated_at: datetime, prefix: string, first_name: string,
middle_name: string, last_name: string, suffix: string, company: string,
title: string, primary_address_id: integer, primary_phone_id: integer,
primary_email_id: integer, aux_info: text, cached_tag_list: string),
Contact(id: integer, org_id: integer, user_id: integer, created_at:
datetime, updated_at: datetime, prefix: string, first_name: string,
middle_name: string, last_name: string, suffix: string, company: string,
title: string, primary_address_id: integer, primary_phone_id: integer,
primary_email_id: integer, aux_info: text, cached_tag_list: string)],
:ferret=>{:lock_retry_time=>2, :key=>[:id, :class_name],
:default_field=>[:middle_name, :last_name, :first_name],
:path=>"/Users/myname/Sites/hg/dev_ferret/index/development/contact",
:analyzer=>#<Ferret::Analysis::StandardAnalyzer:0x30a52dc>,
:create_if_missing=>true, :dir=>#<Ferret::Store::FSDirectory:0x30a5368>,
:or_default=>false, :auto_flush=>true, :handle_parse_errors=>true}}

This message tends to get longer and longer with each request, while the
response from the server gets slower and slower.  The searches work well
enough, but the increasing lag gets irritating really fast.

Any ideas?
Posted by Yannis Jaquet (yannis)
on 2008-10-30 14:17
Jeremy Mcnevin wrote:
> I'm just wondering if this is expected behavior or not in the dev
> environment, and if not, what I could be doing wrong...
> 
> I have a Contact model with the following line:
> 
> acts_as_ferret :fields => [ :first_name, :middle_name, :last_name ]
> 
> Basically, within my controller, the second I initialize my Contact
> model in any way, I get this in the acts_as_ferret.log:
> 
> [contact] register class Contact with index contact
> [contact] ignoring redefinition of ferret field middle_name
> [contact] ignoring redefinition of ferret field last_name
> [contact] ignoring redefinition of ferret field first_name
> [contact] default field list for index contact: [:middle_name,
> :last_name, :first_name]
> 
> This doesn't happen in script/console.
> 
> Also, my development.log gets a HUGE message like this on every
> request...
> 
> configured index for class Contact:
> {:ferret_fields=>{:middle_name=>{:via=>:middle_name,
> :term_vector=>:with_positions_offsets, :index=>:yes, :store=>:no,
...
> :create_if_missing=>true, :dir=>#<Ferret::Store::FSDirectory:0x30a5368>,
> :or_default=>false, :auto_flush=>true, :handle_parse_errors=>true}}
> 
> This message tends to get longer and longer with each request, while the
> response from the server gets slower and slower.  The searches work well
> enough, but the increasing lag gets irritating really fast.
> 
> Any ideas?


Hi Jeremy,
I get the same issue in my development environment (ferret 0.11.6 and 
edge version of acts_as_ferret running on an external drb 
ferret_server). Is that the expected behavior of acts_as_ferret in 
development environment? It is pretty annoying, slowing down so much the 
app...
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.