title: How to merge the results of two queries to different indices in Elasticsearch?
body: <p>I'm searching an index <code>main-kittens</code> for docs of type <code>Kitty</code>. Now, I want to run an experiment. For some of the users, I want to search <code>experiment-kittens</code> instead. The type is the same — <code>Kitty</code>, and all the fields has the same value as in main index, but while the field <code>Bio</code> is always empty in the main index, in experimental one it stores huge strings.</p>
  
  <p>Now, the problem is that I can't store that <code>Bio</code> for all kittens due to memory/disk limitations. So the <code>experiment-kittens</code> has only most recent kittens (say, last month).</p>
  
  <p>I want the search to be left intact for the most users (i.e., always use the main index). For the picked ones, I want to merge the results. The logic should be:</p>
  
  <pre><code>search userquery + date_created &lt; 1 month ago in experiment-kittens
  search userquery + date_created &gt; 1 month ago in main-kittens
  </code></pre>
  
  <p>The results should be sorted by <code>create_date</code>, and there are too many of them to sort them in my app.</p>
  
  <p>Is there a way to ask elastic to execute two different queries on two indices and merge the results?</p>
  
  <p>(I'm also sure there could be more optimal solutions to the problem, please tell me if you have some).</p>