# Supporting file upload & indexing in Rails app with elasticsearch/tire

**URL:** <https://discuss.elastic.co/t/supporting-file-upload-indexing-in-rails-app-with-elasticsearch-tire/8185>\
**Category:** Elasticsearch\
**Created:** [June 21, 2012, 5:10pm UTC](https://discuss.elastic.co/t/supporting-file-upload-indexing-in-rails-app-with-elasticsearch-tire/8185 "2012-06-21T17:10:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meltemi](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Meltemi](https://discuss.elastic.co/u/Meltemi)\
**Post date:** [June 21, 2012, 5:10pm UTC](https://discuss.elastic.co/t/supporting-file-upload-indexing-in-rails-app-with-elasticsearch-tire/8185/1 "2012-06-21T17:10:54Z")

</div>

I'm trying to build a Rails app that allows users to upload (carrierwave)  
reports (PDFs) that are will be automatically indexed (elasticsearch/tire).  
I'm not finding any examples of such a workflow so wondering if maybe I've  
chosen the wrong tools/gems?

We can successfully index PDFs manually (json-rest api) but are struggling  
with how to set up an ActiveModel object and attachment mappings with Tire.

The Report model would have, among other attributes, a string which is the  
pathname to the PDF in the filesystem. How then to have elasticsearch index  
the file in that pathname and also index any other attributes associated  
with said Report object?

Any help, a mock-model, or link to some examples of using Tire with  
attachments (PDFs) would be really helpful. As I've said earlier we can  
index PDFs with elasticsearch alone just not sure how to roll this into a  
Rails app.

---

<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:** [July 6, 2017, 3:23am UTC](https://discuss.elastic.co/t/supporting-file-upload-indexing-in-rails-app-with-elasticsearch-tire/8185/2 "2017-07-06T03:23:03Z")

</div>

Closed on July 6, 2017, 3:23am UTC


