# Mapper attachment plugin vs. pre-parsing and extracting content from binary files

**URL:** https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764
**Category:** Elasticsearch
**Created:** [February 2, 2017, 10:13pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764 "2017-02-02T22:13:38Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [February 2, 2017, 10:13pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/1 "2017-02-02T22:13:38Z")

</div>

In order to search binary files, I have two options that I see:

1. Use the Elastic Mapping Plugin and have Elasticsearch handle all the things.

2. Pre-parse and extract content from binary file. Send parsed content to Elasticsearch.

Number 2 seems like a perfectly viable solution. What's the advantage of using the mapper plugin?

---

<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: [February 3, 2017, 7:47am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/2 "2017-02-03T07:47:46Z")

</div>

Mapper plugin is removed in 6.0. Ingest attachment should be used instead.

But TBH I prefer your solution number 2. It's what I do in [FSCrawler](https://github.com/dadoonet/fscrawler) project.

---

<div class="post-metadata">

### Author: ![David\_Pocivalnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_pocivalnik/32/56098_2.png) [@David\_Pocivalnik](https://discuss.elastic.co/u/David_Pocivalnik)
#### Post date: [February 3, 2017, 12:02pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/3 "2017-02-03T12:02:33Z")

</div>

Can you elaborate on why you would choose to parse the documents yourself and not let the ingest-attachment plug-in do the work?

---

<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: [February 3, 2017, 12:24pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/4 "2017-02-03T12:24:00Z")

</div>

Mainly because of some jar conflicts (jarhell checks) we had to reduce the surface of what actually Tika can extract (supported files).  
So if you prefer having a full support of all supported files by Tika, doing that externally will help.

Also, some advanced features like using Tesseract OCR are not be possible with ingest-attachment plugin.

---

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [February 3, 2017, 3:17pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/5 "2017-02-03T15:17:05Z")

</div>

Awesome thanks. Would love to hear from someone from Elastic on this.

---

<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: [February 3, 2017, 3:29pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/6 "2017-02-03T15:29:16Z")

</div>

> [@tlovett1](#):
>
> Would love to hear from someone from Elastic on this.

lol

[http://david.pilato.fr/blog/2017/01/09/4-years-at-elastic/](http://david.pilato.fr/blog/2017/01/09/4-years-at-elastic/)

---

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [February 3, 2017, 3:50pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/7 "2017-02-03T15:50:47Z")

</div>

Sorry about that! Did not read your profile.

---

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [February 3, 2017, 3:51pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/8 "2017-02-03T15:51:43Z")

</div>

David, are there any advantages to the first approach?

---

<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: [February 3, 2017, 4:01pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/9 "2017-02-03T16:01:57Z")

</div>

No worries! Was funny to read 🙂

---

<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: [February 3, 2017, 4:02pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/10 "2017-02-03T16:02:53Z")

</div>

The main advantage is that you don't write/maintain the code.

If you are using ingest-attachment instead of mapper-attachments (removed in 6.0), another advantage is that you can dedicate some nodes as ingest nodes and then share the load on multiple nodes.

---

<div class="post-metadata">

### Author: ![tlovett1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlovett1/32/13950_2.png) [@tlovett1](https://discuss.elastic.co/u/tlovett1)
#### Post date: [February 3, 2017, 4:04pm UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/11 "2017-02-03T16:04:06Z")

</div>

Awesome. Totally makes sense. Thanks.

---

<div class="post-metadata">

### Author: ![David\_Pocivalnik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_pocivalnik/32/56098_2.png) [@David\_Pocivalnik](https://discuss.elastic.co/u/David_Pocivalnik)
#### Post date: [February 6, 2017, 8:14am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/12 "2017-02-06T08:14:42Z")

</div>

thanks for your input!

---

<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: [March 6, 2017, 8:14am UTC](https://discuss.elastic.co/t/mapper-attachment-plugin-vs-pre-parsing-and-extracting-content-from-binary-files/73764/13 "2017-03-06T08:14:55Z")

</div>

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