title: Server error while performing Elasticsearch Reindex in place operation
body: <p>I am using, AWS Elasticsearch service(version 6.3). I am interested in changing mapping while re-indexing data from <code>current_index</code> to <code>new_index</code>. I am not trying to upgrade from older Elasticsearch clusters to new one. Both my <code>current_index</code> and <code>new_index</code> are on the same Elasticsearch 6.3 cluster. 
  <br>I am trying to perform <strong>Reindex in place</strong> operation by following the information from <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-inplace.html" rel="nofollow noreferrer">Elastic documentation</a>
  <br>My index contains about 250k searchable documents. When I <code>POST _reindex</code> request using curl, </p>
  
  <pre><code>curl -X POST "aws_elasticsearch_endpoint/_reindex" -H 'Content-Type: application/json' -d'
  {
    "source": {
      "index": "current_index"
    },
    "dest": {
      "index": "new_index"
    }
  }
  '
  </code></pre>
  
  <p>Elasticsearch starts the reindex process(I verify this by performing <code>GET /_cat/indices?v</code>), and I end up getting <code>curl: (56) Unexpected EOF</code> error. The Reindex operation actually works fine. After about 2 hours the <code>doc.count</code> in <code>new_index</code> matches that of  <code>current_index</code> and <code>status</code> turns <code>green</code></p>
  
  <p><br>If I <code>POST _reindex</code> from Java, I get this error:</p>
  
  <pre><code>java.net.SocketException: Unexpected end of file from server
  </code></pre>
  
  <p>Only when the document size in my index is small(I tried with like 1k searchable documents) is when the Reindex API returns success-fully as specified <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html" rel="nofollow noreferrer">here</a> </p>