# Need some help with Ingest Attachment plugin

**URL:** <https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948>\
**Category:** Elasticsearch\
**Created:** [April 29, 2018, 8:29am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948 "2018-04-29T08:29:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanon123](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kanon123](https://discuss.elastic.co/u/kanon123)\
**Post date:** [April 29, 2018, 8:29am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/1 "2018-04-29T08:29:08Z")

</div>

Hi,  
I got the plugin to work, i can take PDF file and index it using base64.  
I wanted to know if there is any way to analyze the PDF text and get the words count or get the keywords.

Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 30, 2018, 7:09am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/2 "2018-04-30T07:09:29Z")

</div>

keywords might be extracted if available in the document itself as metadata.  
words count are not available. Hopefully at some point you'll get able to get them from metadata as well when this will be merged:

> <https://github.com/elastic/elasticsearch/pull/22339>

---

<div class="post-metadata">

**Author:** ![kanon123](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kanon123](https://discuss.elastic.co/u/kanon123)\
**Post date:** [April 30, 2018, 7:48am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/3 "2018-04-30T07:48:29Z")

</div>

When i use Ingest Attachment i don't get keywords any anything that can help me.  
I just get the file content as string so i can search text on it.  
I need to know if there is any way to get keywords or split all the text to words, sentences, etc..

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 30, 2018, 8:07am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/4 "2018-04-30T08:07:46Z")

</div>

May be share somewhere your binary document that you are indexing? I mean if you don't have keywords as metadata of the document, you can't get keywords extracted then.

But once you have the extracted text, you can may set fielddata to true on that field and compute a terms aggregation to get the most frequent terms? But this is going to use a lot of memory and probably you might get terms like `the, a, one`....

---

<div class="post-metadata">

**Author:** ![kanon123](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kanon123](https://discuss.elastic.co/u/kanon123)\
**Post date:** [April 30, 2018, 8:12am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/5 "2018-04-30T08:12:59Z")

</div>

Let's say i'm working on this PDF file:  
[http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf](http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf)

I'm following this guide: [https://github.com/rahulsinghai/elasticsearch-ingest-attachment-plugin-example](https://github.com/rahulsinghai/elasticsearch-ingest-attachment-plugin-example)  
It looks like they only thing it's doing is taking the base64 data and insert it to elasticsearch db.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 30, 2018, 8:29am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/6 "2018-04-30T08:29:21Z")

</div>

AFAICS there is no keyword in this document. That's why it's not extracted.

(`Mots-clés` means `keyword`)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd44d1efb2c2db877839ab548476e2435a6fdcd3.jpg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 28, 2018, 8:29am UTC](https://discuss.elastic.co/t/need-some-help-with-ingest-attachment-plugin/129948/7 "2018-05-28T08:29:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
