# Storing images in an index

**URL:** https://discuss.elastic.co/t/storing-images-in-an-index/44409
**Category:** Elasticsearch
**Created:** [March 15, 2016, 9:10am UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409 "2016-03-15T09:10:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![marko1](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@marko1](https://discuss.elastic.co/u/marko1)
#### Post date: [March 15, 2016, 9:10am UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409/1 "2016-03-15T09:10:15Z")

</div>

Hi,

I'm indexing data in ES 2.x and each indexed object will have an associated image that I'd need to store (indexing is not required) somewhere. It would appear logical to store the images also in ES to avoid introducing new dependencies.

Is it a good idea to store images in ES or should I put them somewhere else?  
What would be the best way to store images in ES? Should I use the binary or attachment field types or just store images as string using some string encoding?

Is it recommended to store the text and image in the same type or use separate types? Though an image is associated with each textual data object, the lifecycle for producing the text and image may be different.

marko

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 16, 2016, 9:42pm UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409/2 "2016-03-16T21:42:35Z")

</div>

ES isn't really a binary document store, you can do it but it won't be very efficient.

If you want to I'd put the images in their own indices, then the text data elsewhere.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [March 18, 2016, 3:25pm UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409/3 "2016-03-18T15:25:49Z")

</div>

Yeah, image storage typically is something better handled by a filesystem. I'd use some shared filesystem for it probably.

---

<div class="post-metadata">

### Author: ![marko1](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@marko1](https://discuss.elastic.co/u/marko1)
#### Post date: [March 20, 2016, 8:37am UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409/4 "2016-03-20T08:37:43Z")

</div>

Thanks for your feedback!  
I came to the same conclusion and decided to store the images outside of ES.

marko

---

<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 5, 2017, 11:06pm UTC](https://discuss.elastic.co/t/storing-images-in-an-index/44409/5 "2017-07-05T23:06:46Z")

</div>


