# Multiple Types within an Index

**URL:** <https://discuss.elastic.co/t/multiple-types-within-an-index/10230>\
**Category:** Elasticsearch\
**Created:** [January 4, 2013, 6:43pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230 "2013-01-04T18:43:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Tioseco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulo_tioseco/32/2550_2.png) [@Paulo\_Tioseco](https://discuss.elastic.co/u/Paulo_Tioseco)\
**Post date:** [January 4, 2013, 6:43pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/1 "2013-01-04T18:43:48Z")

</div>

Hi All!

I'm just learning Elasticsearch and currently going through the guide, it  
seems like you can create multiple types within an index.

What is the use case of having multiple types within an index?

Is it common to have multiple types within an index?

For example, if I have user and pet documents which have completely  
different mappings, do I put them in the same index but in separate types?  
Or do I create separate index for each?

Thanks,

Paulo

--

---

<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:** [January 4, 2013, 6:53pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/2 "2013-01-04T18:53:50Z")

</div>

If you have a PetStore, I suggest to create an index petstore and store in it  
everything relative to your petstore (user, pets, invoices, ...).  
If you need to analyze your logs files of your webserver petstore, create  
another index logs and store everything relative to logs (apache logs, sql logs,  
es logs...).

That said, you may also want to play with scalability. So you can start year  
2013 with a petstore2013 index with only 1 shard and 1 replica and if you see  
that you have to hold more and more documents, create a new index petstore2014  
with 10 shards (and add an alias petstore on top of them).

As you can see, design is very flexible.

HTH  
David

Le 4 janvier 2013 à 19:43, Paulo Tioseco [paulotioseco@gmail.com](mailto:paulotioseco@gmail.com) a écrit :

> Hi All!
> 
> I'm just learning Elasticsearch and currently going through the guide, it  
> seems like you can create multiple types within an index.
> 
> What is the use case of having multiple types within an index?
> 
> Is it common to have multiple types within an index?
> 
> For example, if I have user and pet documents which have completely different  
> mappings, do I put them in the same index but in separate types? Or do I  
> create separate index for each?
> 
> Thanks,
> 
> Paulo
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![Paulo\_Tioseco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulo_tioseco/32/2550_2.png) [@Paulo\_Tioseco](https://discuss.elastic.co/u/Paulo_Tioseco)\
**Post date:** [January 4, 2013, 7:23pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/3 "2013-01-04T19:23:25Z")

</div>

Thanks for the reply, David.

It's much clearer now. By putting multiple types in one index, I can  
do a search across all types.

So thinking in terms of relational databases and tables, indexes are  
like databases and types are like tables. Except that types are  
"schema-less." Is this a correct analogy?

Paulo

On Fri, Jan 4, 2013 at 10:53 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> If you have a PetStore, I suggest to create an index petstore and store in  
> it everything relative to your petstore (user, pets, invoices, ...).  
> If you need to analyze your logs files of your webserver petstore, create  
> another index logs and store everything relative to logs (apache logs, sql  
> logs, es logs...).
> 
> That said, you may also want to play with scalability. So you can start year  
> 2013 with a petstore2013 index with only 1 shard and 1 replica and if you  
> see that you have to hold more and more documents, create a new index  
> petstore2014 with 10 shards (and add an alias petstore on top of them).
> 
> As you can see, design is very flexible.
> 
> HTH  
> David
> 
> Le 4 janvier 2013 à 19:43, Paulo Tioseco [paulotioseco@gmail.com](mailto:paulotioseco@gmail.com) a écrit :
> 
> Hi All!
> 
> I'm just learning Elasticsearch and currently going through the guide, it  
> seems like you can create multiple types within an index.
> 
> What is the use case of having multiple types within an index?
> 
> Is it common to have multiple types within an index?
> 
> For example, if I have user and pet documents which have completely  
> different mappings, do I put them in the same index but in separate types?  
> Or do I create separate index for each?
> 
> Thanks,
> 
> Paulo
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> --

--

---

<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:** [January 4, 2013, 7:58pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/4 "2013-01-04T19:58:16Z")

</div>

Yes. It make sense. Think type as the Top level entity when you store an object (Hibernate merge with Cascade All option for example).  
BTW, with Elasticsearch you can search across all indexes...

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 janv. 2013 à 20:23, Paulo Tioseco [paulotioseco@gmail.com](mailto:paulotioseco@gmail.com) a écrit :

Thanks for the reply, David.

It's much clearer now. By putting multiple types in one index, I can  
do a search across all types.

So thinking in terms of relational databases and tables, indexes are  
like databases and types are like tables. Except that types are  
"schema-less." Is this a correct analogy?

Paulo

On Fri, Jan 4, 2013 at 10:53 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> If you have a PetStore, I suggest to create an index petstore and store in  
> it everything relative to your petstore (user, pets, invoices, ...).  
> If you need to analyze your logs files of your webserver petstore, create  
> another index logs and store everything relative to logs (apache logs, sql  
> logs, es logs...).
> 
> That said, you may also want to play with scalability. So you can start year  
> 2013 with a petstore2013 index with only 1 shard and 1 replica and if you  
> see that you have to hold more and more documents, create a new index  
> petstore2014 with 10 shards (and add an alias petstore on top of them).
> 
> As you can see, design is very flexible.
> 
> HTH  
> David
> 
> Le 4 janvier 2013 à 19:43, Paulo Tioseco [paulotioseco@gmail.com](mailto:paulotioseco@gmail.com) a écrit :
> 
> Hi All!
> 
> I'm just learning Elasticsearch and currently going through the guide, it  
> seems like you can create multiple types within an index.
> 
> What is the use case of having multiple types within an index?
> 
> Is it common to have multiple types within an index?
> 
> For example, if I have user and pet documents which have completely  
> different mappings, do I put them in the same index but in separate types?  
> Or do I create separate index for each?
> 
> Thanks,
> 
> Paulo
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> --

--

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 5, 2013, 11:16am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/5 "2013-01-05T11:16:39Z")

</div>

Hi,

having index types with different mappings allows you to organize different  
data types, data sources, or different data models in a single index.

Imagine building a library: a library has books, serials, but also CD or  
DVD, or even full-text files online, all in different languages, and all  
have different media identifier numbers (ISBN/EAN, ISSN, CD-Item-No/UPCs,  
URLs).

The challenge is to build a single index with the media stock item number  
as the primary key and with the different media identifiers in an  
identifier field with a comfortable identifier search.

Instead of creating different identifier field types in each document  
class, like you would probably do in a relational database world, you can  
create different index types in Elasticsearch and put the identifier  
numbers in a commonly named field "identifier". This is the power of  
"mapping" in Elasticsearch.

As an example, let's assume three different identifier types. Books have  
ISBN/EAN, CDs have UPCs, and online videos have URLs.

index/type/id = library/books/1

{  
"identifier" : "978-1-933988-17-7"  
}

index/type/id = library/cds/2

{  
"title" : "The first CD ever",  
"identifier" : "042280001124"  
}

index/type/id = library/videos/3

{  
"creator" : "Simon Willnauer",  
"title" : "Lucene 4 Performance Tuning",  
"identifier" : "[http://vimeo.com/55163540](http://vimeo.com/55163540)"  
}

Assume you have many analyzers in the Elasticsearch mapping plus other  
methods to process such identifiers accordingly to their type (for example,  
auto-adding tags for the ID scheme, removing hyphens from ISBNs, extracting  
IDs from video URLs, looking up persistent identifiers, whatever), the  
advantage should be obvious.

Later while searching, you can direct your search client to the index  
"library", and all searches to the "identifier" field will be mapped  
correctly to the effective mapping of the underlying identifier field.

You can even arrange searches to different objects in different index types.

And this approach scales. Adding a new media type to the library is easy.  
Just add a new index type, set up new analyzers in the mapping, and you're  
done.

So, a type is not just a table in the sense of a relational database, it is  
more like a virtual table or a materialized view.

Another example:

Index types can also be organized by custom demand. In a scientific article  
database, you want to add articles, but on different academic subjects or  
field of studies. Scientists like to perform limited searches within  
contributions in their field without using facets, but if you ask them more  
firmly, they also want to search in all articles. Now, you could add a  
custom field to your documents, or you could instrument Elasticsearch and  
create index types for each field of stud. A search UI can direct the field  
of study to the index type much more elegant by REST addressing than  
managing an optional filter term in the query to select the requested field  
of study.

Note, internally in a document, you can refer to a field named "\_type",  
because under the hood, Elasticsearch handles the index type like an  
ordinary non-analyzed field. It is just exposed to the API.

Best regards,

Jörg

--

---

<div class="post-metadata">

**Author:** ![Jan\_Fiedler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_fiedler/32/2518_2.png) [@Jan\_Fiedler](https://discuss.elastic.co/u/Jan_Fiedler)\
**Post date:** [January 5, 2013, 12:24pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/6 "2013-01-05T12:24:25Z")

</div>

Just a clarifying question after all the praise on types: How about the  
Lucene internal memory structures like the infamous field cache (used  
heavily for facet calculation)? Assume I have a single index with types A  
and B and run faceting on a field of type A only (because type B does not  
have that field at all). Doesn't this mean that the Lucene FieldCache still  
has one huge array representing the facet value of all docs of the entire  
index even though it only holds null values for all the documents of type  
B? Assuming that there are many more instances of type B than A isn't that  
quite a resource waste (in terms of RAM) ?

Coming back to the 'when to use types' question: Doesn't this mean that one  
should use types within a single index for very uniform documents only  
(like books, cds, dvd) ?

--

---

<div class="post-metadata">

**Author:** ![Karel\_Minarik\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karel_minarik_2/32/1078_2.png) [@Karel\_Minarik\_2](https://discuss.elastic.co/u/Karel_Minarik_2)\
**Post date:** [January 6, 2013, 7:25am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/7 "2013-01-06T07:25:08Z")

</div>

> Assume you have many analyzers in the Elasticsearch mapping plus other  
> methods to process such identifiers accordingly to their type (for example,  
> auto-adding tags for the ID scheme, removing hyphens from ISBNs, extracting  
> IDs from video URLs, looking up persistent identifiers, whatever), the  
> advantage should be obvious.

Note, though, that you can't set eg. different analyzers for different  
types in the same index (unless this behaviour changed).

Karel

--

---

<div class="post-metadata">

**Author:** ![Karel\_Minarik\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karel_minarik_2/32/1078_2.png) [@Karel\_Minarik\_2](https://discuss.elastic.co/u/Karel_Minarik_2)\
**Post date:** [January 6, 2013, 7:27am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/8 "2013-01-06T07:27:11Z")

</div>

> Coming back to the 'when to use types' question: Doesn't this mean that  
> one should use types within a single index for very uniform documents only  
> (like books, cds, dvd) ?

Yes, that's the original idea, see:  
[http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html](http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html)

Karel

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [January 7, 2013, 6:51pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/9 "2013-01-07T18:51:03Z")

</div>

While technically you can't set one analyzer for one type, it might be  
worth summarizing what you can do.  
You can set:

- an analyzer for a field
- a default analyzer for the index (thus all types in the index)
- a different analyzer for a type at indexing time.

For a field, you define the analyzer in the mapping.  
|analyzer |"The analyzer used to analyze the text contents when  
|analyzed| during indexing and when searching using a query string.  
Defaults to the globally configured analyzer."  
-- [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)

You can define the default for an index in the "index-module".  
"The |default| logical name allows one to configure an analyzer that  
will be used both for indexing and for searching APIs. The  
|default\_index| logical name can be used to configure a default analyzer  
that will be used just when indexing, and the |default\_search| can be  
used to configure a default analyzer that will be used just when searching."  
-- [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/analysis/)

You can pick an analyzer dynamically at index time with the \_analyzer  
meta-field.  
"The |\_analyzer| mapping allows to use a document field property as the  
name of the analyzer that will be used to index the document. "  
-- [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html)

The only application I can see for this last one is as one solution for  
multi-language support.

While you can't set one value for all fields, you can define an analyzer  
(often no analyzer) on every field on every type to configure every  
field. To help you can set the common default for all, then define  
those that are different.

-Paul

On 1/5/2013 11:25 PM, Karel Minařík wrote:

> > Assume you have many analyzers in the Elasticsearch mapping plus  
> > other methods to process such identifiers accordingly to their type  
> > (for example, auto-adding tags for the ID scheme, removing hyphens  
> > from ISBNs, extracting IDs from video URLs, looking up persistent  
> > identifiers, whatever), the advantage should be obvious.
> 
> Note, though, that you can't set eg. different analyzers for different  
> types in the same index (unless this behaviour changed).
> 
> ## Karel

--

---

<div class="post-metadata">

**Author:** ![powidl](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@powidl](https://discuss.elastic.co/u/powidl)\
**Post date:** [February 20, 2014, 3:27am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/10 "2014-02-20T03:27:11Z")

</div>

Later while searching, you can direct your search client to the index "library", and all searches to the "identifier" field will be mapped correctly to the effective mapping of the underlying identifier field.

Hello,

this is exactly what I need (query the identifier for all types), but I'm not able to form the correct query. Can someone give me a short example, how such a query should look like?

My best guess would be:

{  
"query\_string" : {  
"fields" : ["books.identifier", "cds.identifier","videos.identifier"],  
"query" : "123",  
}  
}

But if a new type is added (and in my usecase the type is dynamic, so I don't know the possible types right now - but all types will have a set of common fields), I must update the query - so this is not a good option (for me).

Thanks a lot  
Roland

---

<div class="post-metadata">

**Author:** ![Roland\_Pirklbauer](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Roland\_Pirklbauer](https://discuss.elastic.co/u/Roland_Pirklbauer)\
**Post date:** [February 20, 2014, 3:37am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/11 "2014-02-20T03:37:34Z")

</div>

Am Samstag, 5. Januar 2013 12:16:39 UTC+1 schrieb Jörg Prante:

> Later while searching, you can direct your search client to the index  
> "library", and all searches to the "identifier" field will be mapped  
> correctly to the effective mapping of the underlying identifier field.
> 
> Hello,

this is exactly what I need (query the identifier for all types), but I'm  
not able to form the correct query. Can someone give me a short example,  
how such a query should look like?

My best guess would be:

{  
"query\_string" : {  
"fields" : ["books.identifier",  
"cds.identifier","videos.identifier"],  
"query" : "123",  
}  
}

But if a new type is added (and in my usecase the type is dynamic, so I  
don't know the possible types right now - but all types will have a set of  
common fields), I must update the query - so this is not a good option (for  
me).

Thanks a lot  
Roland

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a959aa1b-0187-4e0b-81e2-6c8879adc9fe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a959aa1b-0187-4e0b-81e2-6c8879adc9fe%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Roland\_Pirklbauer](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Roland\_Pirklbauer](https://discuss.elastic.co/u/Roland_Pirklbauer)\
**Post date:** [March 5, 2014, 5:49am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/12 "2014-03-05T05:49:51Z")

</div>

Am Donnerstag, 20. Februar 2014 04:37:34 UTC+1 schrieb Roland Pirklbauer:

> Am Samstag, 5. Januar 2013 12:16:39 UTC+1 schrieb Jörg Prante:
> 
> > Later while searching, you can direct your search client to the index  
> > "library", and all searches to the "identifier" field will be mapped  
> > correctly to the effective mapping of the underlying identifier field.
> > 
> > Hello,
> 
> this is exactly what I need (query the identifier for all types), but I'm  
> not able to form the correct query. Can someone give me a short example,  
> how such a query should look like?
> 
> My best guess would be:
> 
> {  
> "query\_string" : {  
> "fields" : ["books.identifier",  
> "cds.identifier","videos.identifier"],  
> "query" : "123",  
> }  
> }
> 
> But if a new type is added (and in my usecase the type is dynamic, so I  
> don't know the possible types right now - but all types will have a set of  
> common fields), I must update the query - so this is not a good option (for  
> me).
> 
> Thanks a lot  
> Roland

The answer is quite simple. You can just ignore the type in the fields  
name, so the above example should look like: {

"query" : {  
"term" : { "identifier": "123" }  
}

Hope this can help others with the same simple problem.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5de08a08-4b9e-476b-a11c-b30de670ffde%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5de08a08-4b9e-476b-a11c-b30de670ffde%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [March 5, 2014, 7:59am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/13 "2014-03-05T07:59:09Z")

</div>

That say, I'm wondering if you set your id as document id, it would be more efficient to use multiget API in that case.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 mars 2014 à 06:49, Roland Pirklbauer [powidl1974@gmail.com](mailto:powidl1974@gmail.com) a écrit :

Am Donnerstag, 20. Februar 2014 04:37:34 UTC+1 schrieb Roland Pirklbauer:

> Am Samstag, 5. Januar 2013 12:16:39 UTC+1 schrieb Jörg Prante:
> 
> > Later while searching, you can direct your search client to the index "library", and all searches to the "identifier" field will be mapped correctly to the effective mapping of the underlying identifier field.  
> > Hello,
> 
> this is exactly what I need (query the identifier for all types), but I'm not able to form the correct query. Can someone give me a short example, how such a query should look like?
> 
> My best guess would be:
> 
> {  
> "query\_string" : {  
> "fields" : ["books.identifier",  
> "cds.identifier","videos.identifier"],  
> "query" : "123",  
> }  
> }
> 
> But if a new type is added (and in my usecase the type is dynamic, so I don't know the possible types right now - but all types will have a set of common fields), I must update the query - so this is not a good option (for me).
> 
> Thanks a lot  
> Roland

The answer is quite simple. You can just ignore the type in the fields name, so the above example should look like: {

"query" : {  
"term" : { "identifier": "123" }  
}

## Hope this can help others with the same simple problem.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5de08a08-4b9e-476b-a11c-b30de670ffde%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5de08a08-4b9e-476b-a11c-b30de670ffde%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/B91F5D22-A3A7-4F04-911C-C2EF23557417%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/B91F5D22-A3A7-4F04-911C-C2EF23557417%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Roland\_Pirklbauer](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@Roland\_Pirklbauer](https://discuss.elastic.co/u/Roland_Pirklbauer)\
**Post date:** [March 5, 2014, 5:12pm UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/14 "2014-03-05T17:12:39Z")

</div>

Hello,

The example is a little Bit confussing. The fields in question are Not the id, they are for example the subject, body, creation time of Outlook Elements. The Type is used to distinguish between Mails, contacts and appointments - for example.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4b3d18e8-e781-4c6a-a71e-1e3f7cd2fb6c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4b3d18e8-e781-4c6a-a71e-1e3f7cd2fb6c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:45am UTC](https://discuss.elastic.co/t/multiple-types-within-an-index/10230/15 "2017-07-06T01:45:30Z")

</div>


