# A few questions: Index per "tenant" sharing schemas, dates auto-detected?

**URL:** <https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884>\
**Category:** Elasticsearch\
**Created:** [April 2, 2010, 12:49am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884 "2010-04-02T00:49:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dobesv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dobesv/32/3355_2.png) [@dobesv](https://discuss.elastic.co/u/dobesv)\
**Post date:** [April 2, 2010, 12:49am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884/1 "2010-04-02T00:49:30Z")

</div>

I'd like to make a search system such that each "user" of the system  
has their own set of indexes, but all the user share a common set of  
schemas and field settings.

If I put something in /\_all/tweet/\_mapping will it affect all existing  
and future automatically-created indexes such as /foo/tweet/ and /bar/  
tweet/?

Or, do I have to configure the indexes each time a new user is added,  
and then reconfigure all existing users when a schema is updated?

I notice that the docs say that types can be automatically detected  
like numbers, strings. The example (in  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/index/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/index/)) also  
includes a date, are those detected automatically as well?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 2, 2010, 9:42am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884/2 "2010-04-02T09:42:40Z")

</div>

Hi,

On Fri, Apr 2, 2010 at 3:49 AM, Dobes [dobesv@gmail.com](mailto:dobesv@gmail.com) wrote:

> I'd like to make a search system such that each "user" of the system  
> has their own set of indexes, but all the user share a common set of  
> schemas and field settings.

There was actually a thread similar to this which resulted in this  
issue: [Boot-time Mapping Definitions · Issue #86 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/86). This means  
you can define mappings in advance, and they will automatically be applied  
to all indices created.

> If I put something in /\_all/tweet/\_mapping will it affect all existing  
> and future automatically-created indexes such as /foo/tweet/ and /bar/  
> tweet/?

Thats another option that was discussed, there is an issue for this, and I  
plan to support this notion as well.

> Or, do I have to configure the indexes each time a new user is added,  
> and then reconfigure all existing users when a schema is updated?
> 
> I notice that the docs say that types can be automatically detected  
> like numbers, strings. The example (in  
> [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/index/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/index/)) also  
> includes a date, are those detected automatically as well?

Dates (strings) are automatically detected using the following logic: They  
much have either '-' or ':' in the string, and the date parser manages to  
parse them. If both happen, then they are treated as dates. Note, there was  
a problem with this in 0.5.1, and its fixed in master (upcoming 0.6.0).

-shay.banon

---

<div class="post-metadata">

**Author:** ![dobesv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dobesv/32/3355_2.png) [@dobesv](https://discuss.elastic.co/u/dobesv)\
**Post date:** [April 3, 2010, 4:11am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884/3 "2010-04-03T04:11:49Z")

</div>

For the fix for issue #86, if I update the mapping file(s), would it  
update the mappings for indexes that already exist?

And was that fix included in the last release?

On Apr 2, 2:42 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Hi,
> 
> On Fri, Apr 2, 2010 at 3:49 AM, Dobes [dob...@gmail.com](mailto:dob...@gmail.com) wrote:
> 
> > I'd like to make a search system such that each "user" of the system  
> > has their own set of indexes, but all the user share a common set of  
> > schemas and field settings.
> 
> There was actually a thread similar to this which resulted in this  
> issue:[Boot-time Mapping Definitions · Issue #86 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/86). This means  
> you can define mappings in advance, and they will automatically be applied  
> to all indices created.
> 
> > If I put something in /\_all/tweet/\_mapping will it affect all existing  
> > and future automatically-created indexes such as /foo/tweet/ and /bar/  
> > tweet/?
> 
> Thats another option that was discussed, there is an issue for this, and I  
> plan to support this notion as well.
> 
> > Or, do I have to configure the indexes each time a new user is added,  
> > and then reconfigure all existing users when a schema is updated?
> 
> > I notice that the docs say that types can be automatically detected  
> > like numbers, strings. The example (in  
> > [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/index/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/index/)) also  
> > includes a date, are those detected automatically as well?
> 
> Dates (strings) are automatically detected using the following logic: They  
> much have either '-' or ':' in the string, and the date parser manages to  
> parse them. If both happen, then they are treated as dates. Note, there was  
> a problem with this in 0.5.1, and its fixed in master (upcoming 0.6.0).
> 
> -shay.banon

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 3, 2010, 9:33am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884/4 "2010-04-03T09:33:19Z")

</div>

On Sat, Apr 3, 2010 at 7:11 AM, Dobes [dobesv@gmail.com](mailto:dobesv@gmail.com) wrote:

> For the fix for issue #86, if I update the mapping file(s), would it  
> update the mappings for indexes that already exist?

No, when you update the mappings, it will only be applied to new indices  
created.

> And was that fix included in the last release?

Not in 0.5.1. It is in master and will be included in 0.6.0 which I hope to  
release in the coming days.

> On Apr 2, 2:42 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Hi,
> > 
> > On Fri, Apr 2, 2010 at 3:49 AM, Dobes [dob...@gmail.com](mailto:dob...@gmail.com) wrote:
> > 
> > > I'd like to make a search system such that each "user" of the system  
> > > has their own set of indexes, but all the user share a common set of  
> > > schemas and field settings.
> > 
> > There was actually a thread similar to this which resulted in this  
> > issue:[Boot-time Mapping Definitions · Issue #86 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/86). This  
> > means  
> > you can define mappings in advance, and they will automatically be  
> > applied  
> > to all indices created.
> > 
> > > If I put something in /\_all/tweet/\_mapping will it affect all existing  
> > > and future automatically-created indexes such as /foo/tweet/ and /bar/  
> > > tweet/?
> > 
> > Thats another option that was discussed, there is an issue for this, and  
> > I  
> > plan to support this notion as well.
> > 
> > > Or, do I have to configure the indexes each time a new user is added,  
> > > and then reconfigure all existing users when a schema is updated?
> > 
> > > I notice that the docs say that types can be automatically detected  
> > > like numbers, strings. The example (in  
> > > [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/index/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/index/)) also  
> > > includes a date, are those detected automatically as well?
> > 
> > Dates (strings) are automatically detected using the following logic:  
> > They  
> > much have either '-' or ':' in the string, and the date parser manages to  
> > parse them. If both happen, then they are treated as dates. Note, there  
> > was  
> > a problem with this in 0.5.1, and its fixed in master (upcoming 0.6.0).
> > 
> > -shay.banon

---

<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, 4:24am UTC](https://discuss.elastic.co/t/a-few-questions-index-per-tenant-sharing-schemas-dates-auto-detected/2884/5 "2017-07-06T04:24:53Z")

</div>


