# Placing multiple files and data under an index

**URL:** <https://discuss.elastic.co/t/placing-multiple-files-and-data-under-an-index/238630>\
**Category:** Elasticsearch\
**Created:** [June 25, 2020, 9:44am UTC](https://discuss.elastic.co/t/placing-multiple-files-and-data-under-an-index/238630 "2020-06-25T09:44:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 25, 2020, 10:23am UTC](https://discuss.elastic.co/t/placing-multiple-files-and-data-under-an-index/238630/4 "2020-06-25T10:23:12Z")

</div>

Yes.

```auto
POST /faq_comp1/_doc
{
  "company": "1",
  "content": "foo bar"
}
POST /faq_comp2/_doc
{
  "company": "2",
  "content": "foo bar"
}

```

Then

```auto
# Get all from company 1
GET /faq_comp1/_search
# Get all from company 1
GET /faq_comp2/_search
# Get all from all companies
GET /_search

```

Is that what you are asking for?

You can also look at aliases and filtered aliases and do something like:

```auto
POST /faq/_doc
{
  "company": "1",
  "content": "foo bar"
}
POST /faq/_doc
{
  "company": "2",
  "content": "foo bar"
}

```

If you create an alias `faq_comp1` which filters on `"company": "1"` and another one for the second company, you will be able to run:

```auto
# Get all from company 1
GET /faq_comp1/_search
# Get all from company 1
GET /faq_comp2/_search
# Get all from all companies
GET /_search

```

If you want to secure all that, you can secure you indices and your aliases with the built-in security.

---

_[View the full topic](https://discuss.elastic.co/t/placing-multiple-files-and-data-under-an-index/238630)._
