# How best to model documents with related user data?

**URL:** <https://discuss.elastic.co/t/how-best-to-model-documents-with-related-user-data/357>\
**Category:** Elasticsearch\
**Created:** [May 7, 2015, 8:06pm UTC](https://discuss.elastic.co/t/how-best-to-model-documents-with-related-user-data/357 "2015-05-07T20:06:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bleupen](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@bleupen](https://discuss.elastic.co/u/bleupen)\
**Post date:** [May 7, 2015, 8:06pm UTC](https://discuss.elastic.co/t/how-best-to-model-documents-with-related-user-data/357/1 "2015-05-07T20:06:22Z")

</div>

Hello!

I am trying to figure out the best way to store documents have associated user-specific settings (e.g. isFavorite, lastAccessed).

I would like the to allow users to filter and sort their content based on these settings. I have looked into parent/child and nested models and both feel awkward. Parent/Child is easy to update and filter by but I can't make it sort (e.g. "Show me all of my content ordered by the time I last accessed it"). Nested updates seem complicated.

Any tips?

Thanks!

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [September 16, 2015, 6:32am UTC](https://discuss.elastic.co/t/how-best-to-model-documents-with-related-user-data/357/2 "2015-09-16T06:32:03Z")

</div>

did u explore array of objects (not nested objects)?

---

<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:50pm UTC](https://discuss.elastic.co/t/how-best-to-model-documents-with-related-user-data/357/3 "2017-07-05T23:50:07Z")

</div>

Closed on July 5, 2017, 11:50pm UTC


