title: Rails + Thinking-Sphinx polymorphic association
body: <pre><code>class User &lt; ActiveRecord::Base
    has_many :followings, :as =&gt; :followable, :dependent =&gt; :destroy, :class_name =&gt; 'Follow'
    has_many :follows, :as =&gt; :follower, :dependent =&gt; :destroy
  
    define_index do
      has follows.followable(:id), :as =&gt; :followable_id
      has followings.follower(:id), :as =&gt; :follower_id
      has follows.followable(:type), :as =&gt; :followable_type
      has followings.follower(:type), :as =&gt; :follower_type
    end
  end 
  </code></pre>
  
  <ol>
  <li><p>question: I can not search by type (always empty array). A bug? I would like to get all users where followers are of type 'AAA'.</p>
  
  <p>User.search '', :with => { :follower_type => 'AAA' }</p></li>
  <li><p>question: Why do I have to inverse my association to get the right result (index definition):
  follows.followable(:id), :as => :followable_id
  instead of
  followings.followable(:id), :as => :followable_id
  I would like to get a list of followers for a user with id=1</p>
  
  <p>User.search :with => {:followable_id => 1}  # List of followers for a user with id=1</p></li>
  </ol>
  
  <p>Thx!</p>