# Can a "multi\_type" type contain different "token\_count"s for the different fields?

**URL:** <https://discuss.elastic.co/t/can-a-multi-type-type-contain-different-token-count-s-for-the-different-fields/17061>\
**Category:** Elasticsearch\
**Created:** [April 17, 2014, 3:27pm UTC](https://discuss.elastic.co/t/can-a-multi-type-type-contain-different-token-count-s-for-the-different-fields/17061 "2014-04-17T15:27:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thale\_jacobs](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@thale\_jacobs](https://discuss.elastic.co/u/thale_jacobs)\
**Post date:** [April 17, 2014, 3:27pm UTC](https://discuss.elastic.co/t/can-a-multi-type-type-contain-different-token-count-s-for-the-different-fields/17061/1 "2014-04-17T15:27:06Z")

</div>

Hello - I have a es mapping that looks like this for a "multi\_field" type:

"Name": {  
"type": "multi\_field",  
"path" : "just\_name",  
"fields" : {  
"Name" : {"store" : "no","type" : "string"},  
"Name\_TC": {"type": "token\_count","analyzer" : "simple", "store"  
: "no"},  
"Name\_Std" : {"store" : "no", "type" : "string"},  
"Name\_Std\_NA" : {"store" : "no", "type" : "string", "index" :  
"not\_analyzed"}, }  
}

This stores the token counts for the "Name" field. Great.

Now if I wanted to also store the token counts for the "Name\_Std" field,  
how would I do it?

"Name": {  
"type": "multi\_field",  
"path" : "just\_name",  
"fields" : {  
"Name" : {"store" : "no","type" : "string"},  
"Name\_TC": {"type": "token\_count","analyzer" : "simple", "store"  
: "no"},  
"Name\_Std" : {"store" : "no", "type" : "string"},  
"Name\_Std\_TC": {"type": "token\_count","analyzer" : "simple",  
"store" : "no"},  
"Name\_Std\_NA" : {"store" : "no", "type" : "string", "index" :  
"not\_analyzed"}, }  
}

I tried this adding: "Name\_Std\_TC": {"type": "token\_count","analyzer" :  
"simple", "store" : "no"},  
but clearly this will not work because I did not specify what field the  
Name\_Std\_TC should store the token count for, so it counts the tokens in  
the default field of "Name".

Is there a way to specify the field name fore a multi\_field type to get the  
token count for that specific field?

Thanks!

--  
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/4d763748-11ab-42c1-805f-7133cccc96a7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4d763748-11ab-42c1-805f-7133cccc96a7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:35am UTC](https://discuss.elastic.co/t/can-a-multi-type-type-contain-different-token-count-s-for-the-different-fields/17061/2 "2017-07-06T01:35:12Z")

</div>


