# Dynamic template multi-field w/ \_all combo analyzer issue?

**URL:** <https://discuss.elastic.co/t/dynamic-template-multi-field-w--all-combo-analyzer-issue/15998>\
**Category:** Elasticsearch\
**Created:** [February 25, 2014, 12:22am UTC](https://discuss.elastic.co/t/dynamic-template-multi-field-w--all-combo-analyzer-issue/15998 "2014-02-25T00:22:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asanderson](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@asanderson](https://discuss.elastic.co/u/asanderson)\
**Post date:** [February 25, 2014, 12:22am UTC](https://discuss.elastic.co/t/dynamic-template-multi-field-w--all-combo-analyzer-issue/15998/1 "2014-02-25T00:22:15Z")

</div>

I'm seeing duplicate concatenated values when using the combo analyzer for  
\_all using a multi-field defined in a dynamic template.

e.g. Instead of seeing "Foo Bar" when listing the \_all terms aggregation,  
I'm seeing "Foo Bar Foo Bar" for the token because my mulit-field defines 2  
sub-fields. If the multi-field is defined with 4 sub-fields, then "Foo Bar"  
is concatenated 4 times.

My set up is below.

_Elasticsearch 1.0.0 on CentOs 6.4 with Java 1.7.0\_51._

_$ES\_HOME/config/default-mapping.json:_  
{  
"_default_": {  
"\_all": {  
"enabled": true,  
"analyzer": "combo",  
"store": false  
},  
"dynamic\_templates": {  
"string\_multifield\_template": {  
"match": "\*",  
"match\_mapping\_type": "string",  
"mapping": {  
"include\_in\_all": false,  
"fields": {  
"{name}": {  
"index": "not\_analyzed",  
"store": true,  
"type": "string"  
},  
"lowercase": {  
"analyzer": "lowercase",  
"index": "analyzed",  
"store": false,  
"type": "string"  
}  
}  
}  
}  
}  
}  
}

_$ES\_HOME/config/elasticsearch.yml:_  
...  
index.analysis.analyzer.lowercase.type: custom  
index.analysis.analyzer.lowercase.tokenizer: keyword  
index.analysis.analyzer.lowercase.filter [lowercase]

index.analysis.analyzer.combo.type: custom  
index.analysis.analyzer.combo.sub\_analyzers: [keyword, lowercase]  
index.analysis.analyzer.combo.deduplication: true  
index.analysis.analyzer.combo.tokenstream\_reuse: false  
...

The aggregation query I use is the following:  
{  
"aggs": {  
"\_all": {  
"terms": {  
"field": "\_all"  
}  
}  
}  
}

Thoughts?

--  
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/f9344d45-33e6-45eb-b193-fdf1d24ebc1b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f9344d45-33e6-45eb-b193-fdf1d24ebc1b%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:47am UTC](https://discuss.elastic.co/t/dynamic-template-multi-field-w--all-combo-analyzer-issue/15998/2 "2017-07-06T01:47:38Z")

</div>

Closed on July 6, 2017, 1:47am UTC


