# Strange behavior with acts\_as\_ferret in dev environment

**URL:** <https://www.ruby-forum.com/t/strange-behavior-with-acts-as-ferret-in-dev-environment/130279>\
**Category:** Ferret\
**Created:** [February 27, 2008, 12:28am UTC](https://www.ruby-forum.com/t/strange-behavior-with-acts-as-ferret-in-dev-environment/130279 "2008-02-27T00:28:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaziarz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e0b2c6/32.png) [@jmaziarz](https://www.ruby-forum.com/u/jmaziarz)\
**Post date:** [February 27, 2008, 12:28am UTC](https://www.ruby-forum.com/t/strange-behavior-with-acts-as-ferret-in-dev-environment/130279/1 "2008-02-27T00:28:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmaziarz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e0b2c6/32.png) [@jmaziarz](https://www.ruby-forum.com/u/jmaziarz)\
**Post date:** [October 30, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/strange-behavior-with-acts-as-ferret-in-dev-environment/130279/2 "2008-10-30T14:17:11Z")

</div>

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…
