# Elasticsearch attachment parsing usecase

**URL:** <https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177>\
**Category:** Elasticsearch\
**Created:** [April 4, 2017, 4:23pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177 "2017-04-04T16:23:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![svb01](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@svb01](https://discuss.elastic.co/u/svb01)\
**Post date:** [April 4, 2017, 4:23pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/1 "2017-04-04T16:23:21Z")

</div>

Hi,

I am exploring ElasticSearch as a solution for one of our usecase. I wanted to know whether the current ElasticSearch capabilities could meet our requirements.  
For our use case, we want to index excel files in our repository.  
The excel files have a standard template. The data is present in 2 columns. Column A contains certain "questions" and Column B has the answers to those questions  
For our use case, if the user searches for a question (say on Row 19 A, we want to be able to show him the answers in column B ( i.e Row 19 B).

From what I have read, I would have to use the ingest-attachment plugin to index the files. However once I have the files indexed, would I be able to map the contents of the files as "Key", "Value" pairs in the index to search on?

What would be the best way to go about this?

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 4, 2017, 4:58pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/2 "2017-04-04T16:58:20Z")

</div>

No you can't. You'd better convert your document into CSV then import it with Logstash for example.

Here is an example: [http://david.pilato.fr/blog/2015/04/28/exploring-capitaine-train-dataset/](http://david.pilato.fr/blog/2015/04/28/exploring-capitaine-train-dataset/)

---

<div class="post-metadata">

**Author:** ![svb01](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@svb01](https://discuss.elastic.co/u/svb01)\
**Post date:** [April 4, 2017, 9:04pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/3 "2017-04-04T21:04:49Z")

</div>

Thanks for the quick reply.  
A follow-up question - The initial excel files are converted into html files using a tool we have. Would it be easier to index the html file directly in ElasticSearch via ingest-attachment?  
Or is log-stash be the preferred approach to transform the data ( excel or html) before pushing to ElasticSearch?

---

<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 4, 2017, 9:16pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/4 "2017-04-04T21:16:02Z")

</div>

I believe you need structured data not unstructured.

So HTML won't help in my opinion.

---

<div class="post-metadata">

**Author:** ![svb01](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@svb01](https://discuss.elastic.co/u/svb01)\
**Post date:** [April 4, 2017, 9:22pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/5 "2017-04-04T21:22:58Z")

</div>

I may not have explained properly.  
We currently already have a process where initial excel files are created from an excel template and converted to a html document.

I have an opportunity to index the file either from the excel doc or from the html doc that is generated; to get the desired output that I mentioned in the initial question.

Would it be easier to use logstash on the excel doc or the converted html document. Or is it the same effort/process using logstash irrespective of the file format.

---

<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 4, 2017, 10:03pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/6 "2017-04-04T22:03:38Z")

</div>

CSV is easier to parse IMO.

---

<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 2, 2017, 10:03pm UTC](https://discuss.elastic.co/t/elasticsearch-attachment-parsing-usecase/81177/7 "2017-05-02T22:03:51Z")

</div>

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