# Aaf excluding certain db records from indexing

**URL:** <https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848>\
**Category:** Ferret\
**Created:** [March 6, 2007, 11:46am UTC](https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848 "2007-03-06T11:46:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![neongrau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neongrau](https://www.ruby-forum.com/u/neongrau)\
**Post date:** [March 6, 2007, 11:46am UTC](https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848/1 "2007-03-06T11:46:26Z")

</div>

hi!

short question about aaf:

is there a builtin functionality in acts\_as\_ferret to exclude records  
from being indexed when for example a column “is\_deleted” /  
“is\_disabled” / “dont\_index” has a certain value?

regards

neongrau

---

<div class="post-metadata">

**Author:** ![neongrau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neongrau](https://www.ruby-forum.com/u/neongrau)\
**Post date:** [March 6, 2007, 2:08pm UTC](https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848/2 "2007-03-06T14:08:53Z")

</div>

On Tue, Mar 06, 2007 at 11:46:26AM +0100, neongrau \_\_ wrote:

> hi!
> 
> short question about aaf:
> 
> is there a builtin functionality in acts\_as\_ferret to exclude records  
> from being indexed when for example a column “is\_deleted” /  
> “is\_disabled” / “dont\_index” has a certain value?

just override the ferret\_enabled? instance method.

cheers,  
Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa

---

<div class="post-metadata">

**Author:** ![neongrau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neongrau](https://www.ruby-forum.com/u/neongrau)\
**Post date:** [March 6, 2007, 2:18pm UTC](https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848/3 "2007-03-06T14:18:34Z")

</div>

Jens K. wrote:  
s\_disabled" / “dont\_index” has a certain value?

> just override the ferret\_enabled? instance method.

hallo jens!

so i just put s.th. like this into my model?

def ferret\_enabled?  
self.is\_deleted ? false : true  
end

and aaf will skip the record when indexing?

---

<div class="post-metadata">

**Author:** ![neongrau](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/34f0e0/32.png) [@neongrau](https://www.ruby-forum.com/u/neongrau)\
**Post date:** [March 6, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/aaf-excluding-certain-db-records-from-indexing/87848/4 "2007-03-06T14:30:59Z")

</div>

On Tue, Mar 06, 2007 at 02:18:34PM +0100, neongrau \_\_ wrote:

> def ferret\_enabled?  
> self.is\_deleted ? false : true  
> end
> 
> and aaf will skip the record when indexing?

that’s right.

However this does not apply to index rebuilds, please see my other  
recent mail to the list for a solution to this problem.

Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa
