Do you mean records that have a specific asset id?
   Model.search 'query', :with => {:asset_id => @asset.id}

Or records that have any assets, not caring what the ids are? Try the  
following (untested):
   has 'COUNT(assets.id)', :as => :asset_count, :type => :integer

   Model.search 'query', :without => {:asset_count => 0}

-- 
Pat

On 04/09/2009, at 5:57 PM, phil wrote:

>
> Sorry - my brain's not quite working right today, so I hope you can
> follow this.
>
> In our define_index we have:
> has assets(:id), :as => :asset_id
>
> This ties to an association. How can I just find records that have an
> asset_id?
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to