# Retrieving multiple types with Ferret

**URL:** <https://www.ruby-forum.com/t/retrieving-multiple-types-with-ferret/156708>\
**Category:** Rails\
**Created:** [January 1, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/retrieving-multiple-types-with-ferret/156708 "2009-01-01T16:58:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [January 1, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/retrieving-multiple-types-with-ferret/156708/1 "2009-01-01T16:58:48Z")

</div>

Hey,  
I want to store multiple different types of items in Ferret. I can  
store  
them all fine but retrieval seems troublesome. When i get items of  
multiple  
types back in a result set, how can I figure out what type they are and  
process accordingly. Does Ferret have some way to retrieve the actual  
object back? That would be ideal.

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [January 1, 2009, 11:38pm UTC](https://www.ruby-forum.com/t/retrieving-multiple-types-with-ferret/156708/2 "2009-01-01T23:38:16Z")

</div>

Jim,

On Thu, Jan 1, 2009 at 10:58 AM, James E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hey,  
> I want to store multiple different types of items in Ferret. I can store  
> them all fine but retrieval seems troublesome. When i get items of multiple  
> types back in a result set, how can I figure out what type they are and  
> process accordingly. Does Ferret have some way to retrieve the actual  
> object back? That would be ideal.
> 
> Thanks,  
> Jim

I posted a tutorial on using shared indexes a while ago, but I think  
it’s still relevant:  
[http://opensoul.org/2008/4/29/using-shared-indexes-with-acts\_as\_ferret](http://opensoul.org/2008/4/29/using-shared-indexes-with-acts_as_ferret)

## Brandon

* * *

Training by Collective Idea: Ruby on Rails training in a vacation  
setting  
[http://training.collectiveidea.com](http://training.collectiveidea.com) – San Antonio, TX – Jan 20-23
