# Help with how to structure data

**URL:** <https://discuss.elastic.co/t/help-with-how-to-structure-data/2417>\
**Category:** Elasticsearch\
**Created:** [June 11, 2015, 7:47am UTC](https://discuss.elastic.co/t/help-with-how-to-structure-data/2417 "2015-06-11T07:47:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asherwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asherwood/32/617_2.png) [@asherwood](https://discuss.elastic.co/u/asherwood)\
**Post date:** [June 11, 2015, 7:47am UTC](https://discuss.elastic.co/t/help-with-how-to-structure-data/2417/1 "2015-06-11T07:47:06Z")

</div>

Hi

I’m currently reviewing Found.no and have been pointed here by their support team to gain a little help on how best to structure the entries into Elasticsearch.

**My situation.**

I'm currently creating a business tool and I'm looking for an efficient way for customers to search their data.

- Each customer in the tool has their own account and should only be able to access their own data. Each account can then have various pieces of information such as projects and then items such as documents, requirements etc… belonging to projects.

- I want to be able to allow customers to search for a single project or a single document in a given project, but also allow them to do a global search to search on all projects / content in their account.

- When users delete content, I want to be able to easily delete a single requirement, but also be able to easily delete a single project with all the content that it contains and a single account with all the projects and data that it contains.

**Questions:**

1. Knowing the above, how would you suggest that I set the \_index, \_type & \_id to be able to easily do the above searches that I mentioned are needed?

2. In the found.no config, I’ve noticed it has a setting of ‘deletion requires name’ which defaults to wildcard. Would there be a way to perform command that does something like ‘Delete all content for this project’ or ‘Delete all content for this account’ without having to cycle over all content piece by piece.

Thanks for your help  
Scott

---

<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:** [June 13, 2015, 4:54am UTC](https://discuss.elastic.co/t/help-with-how-to-structure-data/2417/2 "2015-06-13T04:54:28Z")

</div>

1. Depends, do you have different types and can you safely generate your own unique ID?
2. You can do a scan/scroll then a bulk delete. Most people will use delete-by query here but it's being removed and replaced with this.

Generally in this sort of use case we suggest using aliases per user with a filter to limit access to their documents. That way you can have one or more indices rather than one per user.

---

<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 6, 2017, 12:07am UTC](https://discuss.elastic.co/t/help-with-how-to-structure-data/2417/3 "2017-07-06T00:07:46Z")

</div>

Closed on July 6, 2017, 12:07am UTC


