# List of items

**URL:** <https://discuss.elastic.co/t/list-of-items/28600>\
**Category:** Elasticsearch\
**Created:** [September 3, 2015, 11:52am UTC](https://discuss.elastic.co/t/list-of-items/28600 "2015-09-03T11:52:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![honzabrecka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/honzabrecka/32/4554_2.png) [@honzabrecka](https://discuss.elastic.co/u/honzabrecka)\
**Post date:** [September 3, 2015, 11:52am UTC](https://discuss.elastic.co/t/list-of-items/28600/1 "2015-09-03T11:52:31Z")

</div>

Hi, I'm standing before the following problem. I want to implement a feature called "sets", which means I have a blog posts and a set of blog posts. Each blog post can be present in N sets. Search result should contain a mix of blog posts and sets of blog posts, sorted by relevancy.

blog is an entity with the following keys:  
{id, name, text}

set is an entity with the follwing structure:  
{id, name, blogs: []}

How would you index this data in ElasticSearch, to be efficient to both read and write?

I would save everything as a set (with some metadata that would contain an information if it's real set or not - the case with one blog in set), but update would be expensive - get all sets where the blog is present, update them and save. On the other hand, search works exactly as I want with just one query. Please, advice if there's a better solution.

Thanks!

---

<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:** [September 3, 2015, 12:07pm UTC](https://discuss.elastic.co/t/list-of-items/28600/2 "2015-09-03T12:07:29Z")

</div>

I would probably start with indexing blogs and not sets:

```
{
  id,
  name,
  text,
  set: {
    id,
    name
  }
}

```

Would this work for you?

---

<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:52pm UTC](https://discuss.elastic.co/t/list-of-items/28600/3 "2017-07-05T23:52:15Z")

</div>

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


