How to index a pdf file in Elasticsearch 5.0.0 with ingest-attachment plugin? : <p>I'm new to Elasticsearch and I read here <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/master/mapper-attachments.html">https://www.elastic.co/guide/en/elasticsearch/plugins/master/mapper-attachments.html</a> that the mapper-attachments plugin is deprecated in elasticsearch 5.0.0.</p>

<p>I now try to index a pdf file with the new ingest-attachment plugin and upload the attachment. </p>

<p>What I've tried so far is</p>

<pre><code>curl -H 'Content-Type: application/pdf' -XPOST localhost:9200/test/1 -d @/cygdrive/c/test/test.pdf
</code></pre>

<p>but I get the following error:</p>

<pre><code>{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}
</code></pre>

<p>I would expect that the pdf file will be indexed and uploaded. What am I doing wrong?</p>

<p>I also tested Elasticsearch 2.3.3 but the mapper-attachments plugin is not valid for this version and I don't want to use any older version of Elasticsearch.</p>
