title: How to search by association with Sunspot?
body: <p>I have 2 models:</p>
  
  <pre><code>class UserPrice &lt; ActiveRecord::Base
    attr_accessible :price, :product_name
    belongs_to :user
    belongs_to :product
  
    searchable do
       integer :product_id do
         product.map(&amp;:name)
       end
     end
  
    # Associations on form like "choosing a category".
    def product_name
      product.name if product
    end
  
    def product_name=(name)
      self.product = Product.find_or_create_by_name(name) unless name.blank?
    end
  end
  
  ---------------------------------------------------------------------------------
  class Product &lt; ActiveRecord::Base
    attr_accessible :name
    has_many :user_prices
    has_many :users, :through =&gt; :user_prices
  end
  </code></pre>
  
  <p>I want to search inside of my UserPrice model but search by the Products name. How is that done inside of the block?</p>