Indexing pdf documents

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Have a look at: https://www.elastic.co/blog/the-future-of-attachments-for-elasticsearch-and-dotnet

Note that the original text won't be part of the _source document when using mapper-attachments plugin. You should use ingest-attachment instead as explained in "The future" part of the page I linked to..