karmi/tire — Issue #230: Possible to acces both Item and AR instances in result set?
Author: joshcutler
Created: 2012-02-05 22:36:26+00:00
State: open

First of all thanks for all of the work on this gem. I was wondering if it is possible to access bot the Tire result Item as well as its ActiveRecord instance using the :load => true parameter. I need to do this because ES is storing some aggregate information that is not contained in my AR instance.

Ideally I could do something like:

results = MyClass.search "test", :load => true

ar_instance = results.first
item_instance = results.items.first

Or something like that. Is this supported?

Thanks,
-=Josh