# What will be the mapping and DSL for creating a organisation employee profile user with maximum upload of 3 photos for storing and searching his photos please of image with timestamp

**URL:** <https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427>\
**Category:** Elasticsearch\
**Created:** [January 7, 2021, 10:13am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427 "2021-01-07T10:13:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 7, 2021, 10:13am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/1 "2021-01-07T10:13:16Z")

</div>

A.What will be the mapping and DSL query structure example for creating a organisation employee profile user

1. with maximum upload of n photo limit with
2. image size nMb and
3. x height , y width

for storing and searching his photos please of image with timestamp please.

B. is it good fast perfomance and easier to store profile image  
1.Directly in ES for search or  
2. store in say other Aws S3 and access meta data image catalogue in ES for search ..  
.which option is best pls. ?

---

<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:** [January 9, 2021, 2:57am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/2 "2021-01-09T02:57:33Z")

</div>

Welcome to our community! 😃

Elasticsearch isn't a binary store, so I would use it for the metadata search and then store the images elsewhere.

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 9, 2021, 10:41am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/3 "2021-01-09T10:41:31Z")

</div>

Hi Warkolm ,

Thanks for taking time and answering the question , really helpful.

I have below futher questions on your comment.

As per below discussion ,it was said that images can be stored in binary image type in below 2 links in AWS elasticsearch uses AWS EBS storage . please suggest

1. [Can Elastic hold/store images?](https://discuss.elastic.co/t/can-elastic-hold-store-images/190597)

> [@Can Elastic hold/store images?](https://discuss.elastic.co/t/can-elastic-hold-store-images/190597):
>
> Is it possible for Elastic to store images? If so, are there only specific data types? Would they be processed or stored the same way all other data is stored i.e. index, type, docs, etc.

[dadoonet](https://discuss.elastic.co/u/dadoonet)[David Pilato](https://discuss.elastic.co/u/dadoonet)Developer | Evangelist

[Jul 2019](https://discuss.elastic.co/t/can-elastic-hold-store-images/190597/2)

You can store images using the `binary` type. But I'd not store big images IMHO.  
See [Binary field type | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/binary.html)

1. [Binary field type | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/binary.html)

---

<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:** [January 9, 2021, 11:29am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/4 "2021-01-09T11:29:40Z")

</div>

You mentioned some megabytes for images. This is not "small" IMO.

Something like few bytes or kilobytes would be probably ok.

If you want to do it, I'd probably store images in another dedicated index and index the metadata in the main index.

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 9, 2021, 11:49am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/5 "2021-01-09T11:49:26Z")

</div>

Thanks Dadoonet , currently the File size limit for user profile photos is : 400 kb. we planned to use AWS elasticsearch with default EBS storage as one of option . yes elasticsearch image index and another elasticsearch metadata index is wonderful idea .thanks again .

---

<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:** [January 9, 2021, 12:17pm UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/6 "2021-01-09T12:17:29Z")

</div>

We won't be able to support you as AWS elasticsearch is not running our official code and service.

Did you look at [Cloud by Elastic](https://www.elastic.co/cloud), also available if needed from [AWS Marketplace](https://aws.amazon.com/marketplace/pp/B01N6YCISK) ?

Cloud by elastic is one way to have access to **all features** , all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named [Observability](https://www.elastic.co/observability), [Security](https://www.elastic.co/security), [Enterprise Search](https://www.elastic.co/enterprise-search) and what is coming next 🙂 ...

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 9, 2021, 1:57pm UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/7 "2021-01-09T13:57:40Z")

</div>

Thanks for the inforamtion

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 12, 2021, 5:58am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/8 "2021-01-12T05:58:13Z")

</div>

Hi Dadoonet,  
With respect to having 2 indexes do you prefer parent-child or nested objects type please ?  
for performance and below requirements  
of adding say 3 images to a customer profile ..

eg., Data struture is

cutomer details (index 1)  
-\>  
image details (index2 )  
(customer can add 3 profile images) with timestamp ,latest display as main image and search photo functionality ..

---

<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:** [January 12, 2021, 6:15am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/9 "2021-01-12T06:15:08Z")

</div>

None of them.

I'd just put the id of the images or the url in the main index. And I'd "do the join" on the client side. Which means multiple calls if you want to display the results.

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 13, 2021, 11:20pm UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/10 "2021-01-13T23:20:14Z")

</div>

Thanks , Join seems good idea.

I have a query on the same as we use stream technology of current data like customer in one db and stream to ES .

so will it be the "join" in mongo/dynamodb stream **alone or both** ES and mangodb/dynamodb . as we use stream of dynamodb to ES of customer details .

ie., we store the customer details in seperate db like mongodb /dynamodb and stream details to elasticsearch ,ES is used for search faster query .

in this case, can we still keep customer details in mongo/dynamo and add their photo details alone directly in elastic search by updating the mapping/index in elastic search directly ( directly means without stream of photo details) so do the join of customer table stream in mango /dynamodb and the customer id and images details directly in ES ?

storing binaary images base64 in dynamo or mango ie., having joins in mangodb/dynamo with images and then streaming in ES may be bad idea as the images size is large and has constrain in dynamodb like 400kb per item

please advise ?

---

<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:** [January 14, 2021, 3:16am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/11 "2021-01-14T03:16:02Z")

</div>

I don't know DynamoDB or MongoDB so I can't comment.

But if the binary images are already there, I'd keep them in that place instead of copying into elasticsearch the images.

A GET by id in MongoDB is normally super fast I believe.

---

<div class="post-metadata">

**Author:** ![rajends1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajends1/32/81884_2.png) [@rajends1](https://discuss.elastic.co/u/rajends1)\
**Post date:** [January 14, 2021, 6:05am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/12 "2021-01-14T06:05:43Z")

</div>

Thanks Again. The binary images are never implemented in dynamodb as this adding photos to customer profile is new requirement. so will it be ok to directlyadd images in ES while the customer data is still in dynamo and also streamed into ES

so the ES will have part of customer data streamed from dynamo and other join part is images directly (not streamed from dynamo) added into ES are associated to customer data streamed from dynamo .

so before adding new photos we need to get customer id created by streaming from dynamo in ES and then add customer images to it for searching in dynamo latter.

 ![ES1](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd8e1656ce9941d67036b90f7c00df3963af8ab4.png)

---

<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:** [February 11, 2021, 6:05am UTC](https://discuss.elastic.co/t/what-will-be-the-mapping-and-dsl-for-creating-a-organisation-employee-profile-user-with-maximum-upload-of-3-photos-for-storing-and-searching-his-photos-please-of-image-with-timestamp/260427/13 "2021-02-11T06:05:45Z")

</div>

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