title: Create an index from search results using _reindex API
body: <p>I'am tring to store the results of my search request in new index.
  This is my code:</p>
  <pre><code>POST /_reindex
  { 
    &quot;source&quot;: {
      &quot;index&quot;: &quot;my_index_name&quot;,
      &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;match&quot;: {
              &quot;host.hostname&quot;: &quot;value_1&quot;
            }
          },
          {
            &quot;match&quot;: {
              &quot;message&quot;: &quot;value_a&quot;
            }
          }
        ]
      }
    },
     &quot;size&quot;:3
    },
    &quot;dest&quot;: {
      &quot;index&quot;: &quot;new_test&quot;
    }
  }
  </code></pre>
  <p>This request is limited to a size of 3. However the size limit is not taken into account. Hence the Post request result is 502 error with this message:</p>
  <pre><code>{&quot;ok&quot;:false,&quot;message&quot;:&quot;backend closed connection&quot;}
  </code></pre>
  <p>My question is how can i store the result of the request above in a new index in ELasticsearch?
  Thank you in advance for your help.</p>