title: Searchkick manual reindex on associations while testing
body: <p>I'm manually calling re index on associations so that they are up-to-date as prescribed by the <a href="https://github.com/ankane/searchkick#associations" rel="nofollow noreferrer">docs</a>.</p>
  
  <p>HOWEVER, in my testing environment, the reindex calls are throwing an error. On CI the error is an understandable port 9200 isn't running as ES is not running. Locally, the error looks more like this showing that the document doesn't exist.</p>
  
  <p>I have the prescribed <code>Searchkick.disable_callbacks</code> in my test_helper</p>
  
  <p>Setup:</p>
  
  <pre><code>class Parent &lt; ApplicationRecord
    belongs_to :client
  
    searchkick
  
    def search_data
      { name }.merge(**client_data)
    end
  
    def client_data
      { market_id: client.market_id }
    end
  end
  
  class Client &lt; ApplicationRecord
    has_many :parents
  
    after_save :reindex_parents
  
    def reindex_parents
      parents.reindex(:client_data) # &lt;-- ERROR raised here without `unless Rails.env.test?` guard
    end
  end
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>TestClass#test_name:
  Searchkick::ImportError: {"type"=&gt;"document_missing_exception", "reason"=&gt;"[model][395824130]: document missing", "index_uuid"=&gt;"5UOKtvfvR52x76Nf5njMBQ", "shard"=&gt;"0", "index"=&gt;"students_test"} on item with id '395824130' ....
  </code></pre>
  
  <p>I can avoid the issue by guarding the <code>reindex_parents</code> call with the an <code>unless Rails.env.test?</code> but it seems that there <em>should</em> be a better way</p>
  
  <p>Am I missing something?
  Any ideas?</p>