# Include \_type in \_all

**URL:** <https://discuss.elastic.co/t/include--type-in--all/6717>\
**Category:** Elasticsearch\
**Created:** [February 15, 2012, 3:39pm UTC](https://discuss.elastic.co/t/include--type-in--all/6717 "2012-02-15T15:39:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabor\_Suhai](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@Gabor\_Suhai](https://discuss.elastic.co/u/Gabor_Suhai)\
**Post date:** [February 15, 2012, 3:39pm UTC](https://discuss.elastic.co/t/include--type-in--all/6717/1 "2012-02-15T15:39:32Z")

</div>

Hi,

Is it possible to include the \_type field in the \_all field?  
I tried this mapping:

{  
"mytype": {  
"\_type": {"include\_in\_all": "true"},  
"properties": {  
"name": {  
"store": "true",  
"include\_in\_all": "true",  
"type": "string"  
}  
}  
}  
}

but only the content of the "name" field appears in the \_all field.

Thanks  
Gábor

---

<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:** [February 15, 2012, 7:44pm UTC](https://discuss.elastic.co/t/include--type-in--all/6717/2 "2012-02-15T19:44:57Z")

</div>

No, type is not included in \_all, and you can't control it… . Why do you need it?

On Wednesday, February 15, 2012 at 5:39 PM, Gábor Suhai wrote:

> Hi,
> 
> Is it possible to include the \_type field in the \_all field?  
> I tried this mapping:
> 
> {  
> "mytype": {  
> "\_type": {"include\_in\_all": "true"},  
> "properties": {  
> "name": {  
> "store": "true",  
> "include\_in\_all": "true",  
> "type": "string"  
> }
> 
> ```
> }
> }
> 
> ```
> 
> }
> 
> but only the content of the "name" field appears in the \_all field.
> 
> Thanks  
> Gábor

---

<div class="post-metadata">

**Author:** ![Gabor\_Suhai](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@Gabor\_Suhai](https://discuss.elastic.co/u/Gabor_Suhai)\
**Post date:** [February 16, 2012, 6:23am UTC](https://discuss.elastic.co/t/include--type-in--all/6717/3 "2012-02-16T06:23:09Z")

</div>

I have multiple types in my index and my plan was, for each type, to  
include some properties of the type and the type itself into the \_all  
field, so from a single search field the user can search for the properties  
and the type too.  
Let's say there's a bank called ABC. If I'm looking for a branch, I search  
for "abc branch", but if I'm only interested in ATMs, I search for "abc  
atm", and if any ATM will do, I search for "atm". Branch and ATM is a type,  
and ABC is the value of the name property of these types.

---

<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:** [February 16, 2012, 7:41pm UTC](https://discuss.elastic.co/t/include--type-in--all/6717/4 "2012-02-16T19:41:07Z")

</div>

One way is to just let the user filter the type, something like: \_type:abc (or have your own filtering). Otherwise, that filtering is not really effective usability wise.

On Thursday, February 16, 2012 at 8:23 AM, Gábor Suhai wrote:

> I have multiple types in my index and my plan was, for each type, to include some properties of the type and the type itself into the \_all field, so from a single search field the user can search for the properties and the type too.  
> Let's say there's a bank called ABC. If I'm looking for a branch, I search for "abc branch", but if I'm only interested in ATMs, I search for "abc atm", and if any ATM will do, I search for "atm". Branch and ATM is a type, and ABC is the value of the name property of these types.

---

<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, 3:39am UTC](https://discuss.elastic.co/t/include--type-in--all/6717/5 "2017-07-06T03:39:04Z")

</div>


