# Mapping for query life events of user

**URL:** <https://discuss.elastic.co/t/mapping-for-query-life-events-of-user/200541>\
**Category:** Elasticsearch\
**Created:** [September 21, 2019, 5:57pm UTC](https://discuss.elastic.co/t/mapping-for-query-life-events-of-user/200541 "2019-09-21T17:57:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aess](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aess](https://discuss.elastic.co/u/aess)\
**Post date:** [September 21, 2019, 5:57pm UTC](https://discuss.elastic.co/t/mapping-for-query-life-events-of-user/200541/1 "2019-09-21T17:57:51Z")

</div>

Mapping for time-series data

[Alind](https://www.udemy.com/user/alind-sinha/) ·

Lecture 13

· a minute ago

Hi,

I am trying to create a mapping where intent is to record events for a user and aggregate them based on any given condition,

for example

a user can have

id -1 ,name - Sarah James ,status-Single ,address- ccc,xxxx,date- 01/01/1900

with time it can change to( Status,name and address changed)

id-1 ,name -Sarah James Smith, Status -Married,address- aaa,bbb,date - 01/06/1900

and than again change to (address changed)

id-1 ,name -Sarah James Smith, Status -Married,address- ppp,qqq,date-02/01/1903

At the same time,I also intend to record every purchase event of the user,

id- 1 ,name - Sarah James, Bought:4 wheeler,date -01/01/1900

id- 1 ,name - Sarah James Smith, Bought: Vacuum Cleaner,date -01/01/1901

id- 1 ,name - Sarah James Smith, Bought: Personal Computer,date -01/10/1901

id- 1 ,name - Sarah James Smith, Bought: House,date -01/01/1903

The use case is that I intend to aggregate the purchase history of a user based on time and map it to same id when the purchaser's name is different .

---

<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:** [October 19, 2019, 5:57pm UTC](https://discuss.elastic.co/t/mapping-for-query-life-events-of-user/200541/2 "2019-10-19T17:57:51Z")

</div>

Closed on October 19, 2019, 5:57pm UTC

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