# Aggregations failing on fields with custom analyzer

**URL:** <https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259>\
**Category:** Elasticsearch\
**Created:** [February 19, 2015, 7:31am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259 "2015-02-19T07:31:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 7:31am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/1 "2015-02-19T07:31:40Z")

</div>

I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
that fields are case insensitive..

I have my analyzer as below,

```
    "index": {
        "analysis": {
            "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
                "case_insensitive_keyword_analyzer": {
                    "tokenizer": "keyword",
                    "filter": "lowercase"
                }
            }
        }
    }

```

But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..

{  
"error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
"status" : 500  
}

Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?

The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?

--  
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/6c657449-1279-4813-9e65-262cb81e114f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6c657449-1279-4813-9e65-262cb81e114f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 7:53am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/2 "2015-02-19T07:53:14Z")

</div>

> <https://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear>

Posted in stack over flow as well..

On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:

> I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
> that fields are case insensitive..
> 
> I have my analyzer as below,
> 
> ```
> "index": {
> "analysis": {
> "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> "case_insensitive_keyword_analyzer": {
> "tokenizer": "keyword",
> "filter": "lowercase"
> }
> }
> }
> }
> 
> ```
> 
> But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> 
> {  
> "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> "status" : 500  
> }
> 
> Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> 
> The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?

--  
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/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 8:05am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/3 "2015-02-19T08:05:00Z")

</div>

Did you apply your analyzer to your mapping?

David

> Le 19 févr. 2015 à 08:53, Anil Karaka [anilkaraka@gmail.com](mailto:anilkaraka@gmail.com) a écrit :
> 
> [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> 
> Posted in stack over flow as well..
> 
> > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:  
> > I wanted a custom analyzer that behaves exactly like not\_analyzed, except that fields are case insensitive..
> > 
> > I have my analyzer as below,
> > 
> > ```
> > "index": {
> > "analysis": {
> > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > "case_insensitive_keyword_analyzer": {
> > "tokenizer": "keyword",
> > "filter": "lowercase"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > 
> > {  
> > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > "status" : 500  
> > }
> > 
> > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > 
> > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> 
> --  
> 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/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/492932A0-CBC0-497B-A9D8-C6D707DC09B6%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/492932A0-CBC0-497B-A9D8-C6D707DC09B6%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 8:30am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/4 "2015-02-19T08:30:08Z")

</div>

It was my mistake, the field I was trying to do an aggregation was mapped  
double, I assumed its a string, after seeing some sample documents with  
strings..

Why didn't es throw an error when I'm indexing docs with strings instead of  
double..?

On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:

> Did you apply your analyzer to your mapping?
> 
> David
> 
> Le 19 févr. 2015 à 08:53, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> 
> Posted in stack over flow as well..
> 
> On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:
> 
> > I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
> > that fields are case insensitive..
> > 
> > I have my analyzer as below,
> > 
> > ```
> > "index": {
> > "analysis": {
> > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > "case_insensitive_keyword_analyzer": {
> > "tokenizer": "keyword",
> > "filter": "lowercase"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > 
> > {  
> > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > "status" : 500  
> > }
> > 
> > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > 
> > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 8:32am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/5 "2015-02-19T08:32:32Z")

</div>

I don’t know without a concrete example.  
I’d say that if you map have a type number and you send "123" it could work.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 19 févr. 2015 à 09:30, Anil Karaka [anilkaraka@gmail.com](mailto:anilkaraka@gmail.com) a écrit :
> 
> It was my mistake, the field I was trying to do an aggregation was mapped double, I assumed its a string, after seeing some sample documents with strings..
> 
> Why didn't es throw an error when I'm indexing docs with strings instead of double..?
> 
> On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:  
> Did you apply your analyzer to your mapping?
> 
> David
> 
> Le 19 févr. 2015 à 08:53, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\> a écrit :
> 
> > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear) [http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > 
> > Posted in stack over flow as well..
> > 
> > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:  
> > I wanted a custom analyzer that behaves exactly like not\_analyzed, except that fields are case insensitive..
> > 
> > I have my analyzer as below,
> > 
> > ```
> > "index": {
> > "analysis": {
> > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > "case_insensitive_keyword_analyzer": {
> > "tokenizer": "keyword",
> > "filter": "lowercase"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > 
> > {  
> > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > "status" : 500  
> > }
> > 
> > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > 
> > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/9B7CB626-45FA-4856-B735-8CD6912B7FBD%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/9B7CB626-45FA-4856-B735-8CD6912B7FBD%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 8:39am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/6 "2015-02-19T08:39:55Z")

</div>

"\_source" : {  
"Sort" : "",  
"gt" : "2015-02-18T15:07:10",  
"uid" : "54867dc55b482b04da7f23d8",  
"usId" : "54867dc55b482b04da7f23d7",  
"ut" : "2015-02-18T20:37:10",  
"act" : "productlisting",  
"st" : "2015-02-18T15:07:46",  
"Filter" : "",  
"av" : "3.0.0.0",  
"ViewType" : "SmallSingleList",  
"os" : "Windows",  
"categoryid" : "home-kitchen-curtains-blinds"  
}

"properties" : {  
"uid" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"ViewType" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"usId" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"os" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"Sort" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"Filter" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"categoryid" : {  
"type" : "double"  
},  
"gt" : {  
"format" : "dateOptionalTime",  
"type" : "date"  
},  
"ut" : {  
"format" : "dateOptionalTime",  
"type" : "date"  
},  
"st" : {  
"format" : "dateOptionalTime",  
"type" : "date"  
},  
"act" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
},  
"av" : {  
"analyzer" : "case\_insensitive\_keyword\_analyzer",  
"type" : "string"  
}  
}

A sample document and the index mappings above..

On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:

> I don’t know without a concrete example.  
> I’d say that if you map have a type number and you send "123" it could  
> work.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 09:30, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> It was my mistake, the field I was trying to do an aggregation was mapped  
> double, I assumed its a string, after seeing some sample documents with  
> strings..
> 
> Why didn't es throw an error when I'm indexing docs with strings instead  
> of double..?
> 
> On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:
> 
> > Did you apply your analyzer to your mapping?
> > 
> > David
> > 
> > Le 19 févr. 2015 à 08:53, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > 
> > Posted in stack over flow as well..
> > 
> > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:
> > 
> > > I wanted a custom analyzer that behaves exactly like not\_analyzed,  
> > > except that fields are case insensitive..
> > > 
> > > I have my analyzer as below,
> > > 
> > > ```
> > > "index": {
> > > "analysis": {
> > > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > > "case_insensitive_keyword_analyzer": {
> > > "tokenizer": "keyword",
> > > "filter": "lowercase"
> > > }
> > > }
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > > 
> > > {  
> > > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > > "status" : 500  
> > > }
> > > 
> > > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > > 
> > > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 8:51am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/7 "2015-02-19T08:51:29Z")

</div>

I think you are doing something wrong.

DELETE index  
PUT index  
{  
"mappings": {  
"doc": {  
"properties": {  
"foo": {  
"type": "double"  
}  
}  
}  
}  
}  
PUT index/doc/1  
{  
"foo": "bar"  
}

gives:

{  
"error": "MapperParsingException[failed to parse [foo]]; nested: NumberFormatException[For input string: "bar"]; ",  
"status": 400  
}

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 19 févr. 2015 à 09:39, Anil Karaka [anilkaraka@gmail.com](mailto:anilkaraka@gmail.com) a écrit :
> 
> "\_source" : {  
> "Sort" : "",  
> "gt" : "2015-02-18T15:07:10",  
> "uid" : "54867dc55b482b04da7f23d8",  
> "usId" : "54867dc55b482b04da7f23d7",  
> "ut" : "2015-02-18T20:37:10",  
> "act" : "productlisting",  
> "st" : "2015-02-18T15:07:46",  
> "Filter" : "",  
> "av" : "3.0.0.0",  
> "ViewType" : "SmallSingleList",  
> "os" : "Windows",  
> "categoryid" : "home-kitchen-curtains-blinds"  
> }
> 
> "properties" : {  
> "uid" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "ViewType" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "usId" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "os" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Sort" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Filter" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "categoryid" : {  
> "type" : "double"  
> },  
> "gt" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "ut" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "st" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "act" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "av" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> }  
> }
> 
> A sample document and the index mappings above..
> 
> On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:  
> I don’t know without a concrete example.  
> I’d say that if you map have a type number and you send "123" it could work.
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com) [http://elasticsearch.com/](http://elasticsearch.com/)  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> > Le 19 févr. 2015 à 09:30, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\> a écrit :
> > 
> > It was my mistake, the field I was trying to do an aggregation was mapped double, I assumed its a string, after seeing some sample documents with strings..
> > 
> > Why didn't es throw an error when I'm indexing docs with strings instead of double..?
> > 
> > On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:  
> > Did you apply your analyzer to your mapping?
> > 
> > David
> > 
> > Le 19 févr. 2015 à 08:53, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<\>\> a écrit :
> > 
> > > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear) [http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > > 
> > > Posted in stack over flow as well..
> > > 
> > > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:  
> > > I wanted a custom analyzer that behaves exactly like not\_analyzed, except that fields are case insensitive..
> > > 
> > > I have my analyzer as below,
> > > 
> > > ```
> > > "index": {
> > > "analysis": {
> > > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > > "case_insensitive_keyword_analyzer": {
> > > "tokenizer": "keyword",
> > > "filter": "lowercase"
> > > }
> > > }
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > > 
> > > {  
> > > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > > "status" : 500  
> > > }
> > > 
> > > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > > 
> > > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<\>.  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/BF2E4754-FAEF-4792-A5BF-08B9526AEC43%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/BF2E4754-FAEF-4792-A5BF-08B9526AEC43%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 9:01am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/8 "2015-02-19T09:01:27Z")

</div>

I"m getting this error as well using your PUT requests..

It feels like I'm doing something wrong.. But I don't know what exactly..

I'm using this index template..

> <https://gist.github.com/syllogismos/c2dde4f097fea149e1a0>

I didn't specify a particular mapping from my index but reindexed from a  
previous index.. and ended up with that mapping and documents that looks  
like above.. Am I seeing things and an obvious mistake? So lost right now..

On Thursday, February 19, 2015 at 2:23:10 PM UTC+5:30, David Pilato wrote:

> I think you are doing something wrong.
> 
> DELETE index  
> PUT index  
> {  
> "mappings": {  
> "doc": {  
> "properties": {  
> "foo": {  
> "type": "double"  
> }  
> }  
> }  
> }  
> }  
> PUT index/doc/1  
> {  
> "foo": "bar"  
> }
> 
> gives:
> 
> {  
> "error": "MapperParsingException[failed to parse [foo]]; nested:  
> NumberFormatException[For input string: "bar"]; ",  
> "status": 400  
> }
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 09:39, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> "\_source" : {  
> "Sort" : "",  
> "gt" : "2015-02-18T15:07:10",  
> "uid" : "54867dc55b482b04da7f23d8",  
> "usId" : "54867dc55b482b04da7f23d7",  
> "ut" : "2015-02-18T20:37:10",  
> "act" : "productlisting",  
> "st" : "2015-02-18T15:07:46",  
> "Filter" : "",  
> "av" : "3.0.0.0",  
> "ViewType" : "SmallSingleList",  
> "os" : "Windows",  
> "categoryid" : "home-kitchen-curtains-blinds"  
> }
> 
> "properties" : {  
> "uid" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "ViewType" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "usId" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "os" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Sort" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Filter" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "categoryid" : {  
> "type" : "double"  
> },  
> "gt" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "ut" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "st" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "act" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "av" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> }  
> }
> 
> A sample document and the index mappings above..
> 
> On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:
> 
> I don’t know without a concrete example.  
> I’d say that if you map have a type number and you send "123" it could  
> work.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://elasticsearch.com/](http://elasticsearch.com/)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 09:30, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> 
> It was my mistake, the field I was trying to do an aggregation was mapped  
> double, I assumed its a string, after seeing some sample documents with  
> strings..
> 
> Why didn't es throw an error when I'm indexing docs with strings instead  
> of double..?
> 
> On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:
> 
> Did you apply your analyzer to your mapping?
> 
> David
> 
> Le 19 févr. 2015 à 08:53, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> 
> [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> 
> Posted in stack over flow as well..
> 
> On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:
> 
> I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
> that fields are case insensitive..
> 
> I have my analyzer as below,
> 
> ```
> "index": {
> "analysis": {
> "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> "case_insensitive_keyword_analyzer": {
> "tokenizer": "keyword",
> "filter": "lowercase"
> }
> }
> }
> }
> 
> ```
> 
> But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> 
> {  
> "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> "status" : 500  
> }
> 
> Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> 
> The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit https: [https://groups.google.com/d/optout](https://groups.google.com/d/optout)
> 
> ...

--  
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/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [February 19, 2015, 9:04am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/9 "2015-02-19T09:04:04Z")

</div>

If you can provide a full example working as I did, we can try it and see what is wrong.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 19 févr. 2015 à 10:01, Anil Karaka [anilkaraka@gmail.com](mailto:anilkaraka@gmail.com) a écrit :
> 
> I"m getting this error as well using your PUT requests..
> 
> It feels like I'm doing something wrong.. But I don't know what exactly..
> 
> I'm using this index template.. [default index template with all default settings for snapdeal cluster · GitHub](https://gist.github.com/syllogismos/c2dde4f097fea149e1a0)
> 
> I didn't specify a particular mapping from my index but reindexed from a previous index.. and ended up with that mapping and documents that looks like above.. Am I seeing things and an obvious mistake? So lost right now..
> 
> On Thursday, February 19, 2015 at 2:23:10 PM UTC+5:30, David Pilato wrote:  
> I think you are doing something wrong.
> 
> DELETE index  
> PUT index  
> {  
> "mappings": {  
> "doc": {  
> "properties": {  
> "foo": {  
> "type": "double"  
> }  
> }  
> }  
> }  
> }  
> PUT index/doc/1  
> {  
> "foo": "bar"  
> }
> 
> gives:
> 
> {  
> "error": "MapperParsingException[failed to parse [foo]]; nested: NumberFormatException[For input string: "bar"]; ",  
> "status": 400  
> }
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com) [http://elasticsearch.com/](http://elasticsearch.com/)  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 09:39, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\> a écrit :
> 
> "\_source" : {  
> "Sort" : "",  
> "gt" : "2015-02-18T15:07:10",  
> "uid" : "54867dc55b482b04da7f23d8",  
> "usId" : "54867dc55b482b04da7f23d7",  
> "ut" : "2015-02-18T20:37:10",  
> "act" : "productlisting",  
> "st" : "2015-02-18T15:07:46",  
> "Filter" : "",  
> "av" : "3.0.0.0",  
> "ViewType" : "SmallSingleList",  
> "os" : "Windows",  
> "categoryid" : "home-kitchen-curtains-blinds"  
> }
> 
> "properties" : {  
> "uid" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "ViewType" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "usId" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "os" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Sort" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "Filter" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "categoryid" : {  
> "type" : "double"  
> },  
> "gt" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "ut" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "st" : {  
> "format" : "dateOptionalTime",  
> "type" : "date"  
> },  
> "act" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> },  
> "av" : {  
> "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> "type" : "string"  
> }  
> }
> 
> A sample document and the index mappings above..
> 
> On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:  
> I don’t know without a concrete example.  
> I’d say that if you map have a type number and you send "123" it could work.
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com) [http://elasticsearch.com/](http://elasticsearch.com/)  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 09:30, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<\>\> a écrit :
> 
> It was my mistake, the field I was trying to do an aggregation was mapped double, I assumed its a string, after seeing some sample documents with strings..
> 
> Why didn't es throw an error when I'm indexing docs with strings instead of double..?
> 
> On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:  
> Did you apply your analyzer to your mapping?
> 
> David
> 
> Le 19 févr. 2015 à 08:53, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<\>\> a écrit :
> 
> [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear) [http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> 
> Posted in stack over flow as well..
> 
> On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:  
> I wanted a custom analyzer that behaves exactly like not\_analyzed, except that fields are case insensitive..
> 
> I have my analyzer as below,
> 
> ```
> "index": {
> "analysis": {
> "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> "case_insensitive_keyword_analyzer": {
> "tokenizer": "keyword",
> "filter": "lowercase"
> }
> }
> }
> }
> 
> ```
> 
> But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> 
> {  
> "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> "status" : 500  
> }
> 
> Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> 
> The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<\>.  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<\>.  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit https: [https://groups.google.com/d/optout](https://groups.google.com/d/optout)...
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/42624D1D-8C82-4C93-8C9D-9C300982D188%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/42624D1D-8C82-4C93-8C9D-9C300982D188%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [February 19, 2015, 9:16am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/10 "2015-02-19T09:16:20Z")

</div>

I understand what you are saying.. I was able to recreate the same error  
you showed myself..

I was not able to insert into your index whose mapping is "double", but I  
am able to insert a string into my older index whose mapping is "double"..  
Very weird..  
But I don't know how you could recreate my case..

I'm using this index  
template, [default index template with all default settings for snapdeal cluster · GitHub](https://gist.github.com/syllogismos/c2dde4f097fea149e1a0) and then  
reindexed from an older index.. and it took the mapping as double, and has  
strings in the indexed documents later..

Thanks for your help..

On Thursday, February 19, 2015 at 2:34:14 PM UTC+5:30, David Pilato wrote:

> If you can provide a full example working as I did, we can try it and see  
> what is wrong.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 10:01, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> I"m getting this error as well using your PUT requests..
> 
> It feels like I'm doing something wrong.. But I don't know what exactly..
> 
> I'm using this index template..  
> [default index template with all default settings for snapdeal cluster · GitHub](https://gist.github.com/syllogismos/c2dde4f097fea149e1a0)
> 
> I didn't specify a particular mapping from my index but reindexed from a  
> previous index.. and ended up with that mapping and documents that looks  
> like above.. Am I seeing things and an obvious mistake? So lost right now..
> 
> On Thursday, February 19, 2015 at 2:23:10 PM UTC+5:30, David Pilato wrote:
> 
> > I think you are doing something wrong.
> > 
> > DELETE index  
> > PUT index  
> > {  
> > "mappings": {  
> > "doc": {  
> > "properties": {  
> > "foo": {  
> > "type": "double"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > PUT index/doc/1  
> > {  
> > "foo": "bar"  
> > }
> > 
> > gives:
> > 
> > {  
> > "error": "MapperParsingException[failed to parse [foo]]; nested:  
> > NumberFormatException[For input string: "bar"]; ",  
> > "status": 400  
> > }
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> > [http://elasticsearch.com/](http://elasticsearch.com/)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 19 févr. 2015 à 09:39, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > "\_source" : {  
> > "Sort" : "",  
> > "gt" : "2015-02-18T15:07:10",  
> > "uid" : "54867dc55b482b04da7f23d8",  
> > "usId" : "54867dc55b482b04da7f23d7",  
> > "ut" : "2015-02-18T20:37:10",  
> > "act" : "productlisting",  
> > "st" : "2015-02-18T15:07:46",  
> > "Filter" : "",  
> > "av" : "3.0.0.0",  
> > "ViewType" : "SmallSingleList",  
> > "os" : "Windows",  
> > "categoryid" : "home-kitchen-curtains-blinds"  
> > }
> > 
> > "properties" : {  
> > "uid" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "ViewType" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "usId" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "os" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "Sort" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "Filter" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "categoryid" : {  
> > "type" : "double"  
> > },  
> > "gt" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "ut" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "st" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "act" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "av" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > }  
> > }
> > 
> > A sample document and the index mappings above..
> > 
> > On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:
> > 
> > I don’t know without a concrete example.  
> > I’d say that if you map have a type number and you send "123" it could  
> > work.
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> > [http://elasticsearch.com/](http://elasticsearch.com/)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 19 févr. 2015 à 09:30, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > It was my mistake, the field I was trying to do an aggregation was mapped  
> > double, I assumed its a string, after seeing some sample documents with  
> > strings..
> > 
> > Why didn't es throw an error when I'm indexing docs with strings instead  
> > of double..?
> > 
> > On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:
> > 
> > Did you apply your analyzer to your mapping?
> > 
> > David
> > 
> > Le 19 févr. 2015 à 08:53, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > 
> > Posted in stack over flow as well..
> > 
> > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:
> > 
> > I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
> > that fields are case insensitive..
> > 
> > I have my analyzer as below,
> > 
> > ```
> > "index": {
> > "analysis": {
> > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > "case_insensitive_keyword_analyzer": {
> > "tokenizer": "keyword",
> > "filter": "lowercase"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > 
> > {  
> > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > "status" : 500  
> > }
> > 
> > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > 
> > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit https: [https://groups.google.com/d/optout](https://groups.google.com/d/optout)
> > 
> > ...
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/8ff5dce0-2504-4df4-a3c3-7c5537dbfd98%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8ff5dce0-2504-4df4-a3c3-7c5537dbfd98%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)\
**Post date:** [March 10, 2015, 10:18am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/11 "2015-03-10T10:18:08Z")

</div>

Hello David,

Currently we are using Elasticsearch in production to support heavy  
aggregation queries. It was working fine, but recently data nodes keep  
leaving the cluster regularly.. Each node around 3-5 times a day. And the  
scary part is cluster is in red state for few minutes each day. We tried  
changing the Garbage collector, to G1GC to prevent stop-the-world garbage  
collection state. But it still keeps happening. Nodes keep leaving and  
rejoining the cluster.

We will need some help in fixing our current issues.. Even though nodes are  
leaving and rejoining the cluster, we are only missing around 1000  
documents out of around 10 million documents per day during indexing..  
Still we need to address this issue.

And in addition to that we are going to face some scaling issues in near  
future. We want some production support to validate our current cluster  
setup, shard/replica settings, and indexing settings, not to mention cost  
savings.

I sent the same message on the [elasticsearch.org](http://elasticsearch.org) webpage, and am still  
waiting for their response. How do we approach elasticsearch support?

Thank you.

On Thursday, February 19, 2015 at 2:34:14 PM UTC+5:30, David Pilato wrote:

> If you can provide a full example working as I did, we can try it and see  
> what is wrong.
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> [http://Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 19 févr. 2015 à 10:01, Anil Karaka \<[anilk...@gmail.com](mailto:anilk...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> I"m getting this error as well using your PUT requests..
> 
> It feels like I'm doing something wrong.. But I don't know what exactly..
> 
> I'm using this index template..  
> [default index template with all default settings for snapdeal cluster · GitHub](https://gist.github.com/syllogismos/c2dde4f097fea149e1a0)
> 
> I didn't specify a particular mapping from my index but reindexed from a  
> previous index.. and ended up with that mapping and documents that looks  
> like above.. Am I seeing things and an obvious mistake? So lost right now..
> 
> On Thursday, February 19, 2015 at 2:23:10 PM UTC+5:30, David Pilato wrote:
> 
> > I think you are doing something wrong.
> > 
> > DELETE index  
> > PUT index  
> > {  
> > "mappings": {  
> > "doc": {  
> > "properties": {  
> > "foo": {  
> > "type": "double"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > PUT index/doc/1  
> > {  
> > "foo": "bar"  
> > }
> > 
> > gives:
> > 
> > {  
> > "error": "MapperParsingException[failed to parse [foo]]; nested:  
> > NumberFormatException[For input string: "bar"]; ",  
> > "status": 400  
> > }
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> > [http://elasticsearch.com/](http://elasticsearch.com/)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 19 févr. 2015 à 09:39, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > "\_source" : {  
> > "Sort" : "",  
> > "gt" : "2015-02-18T15:07:10",  
> > "uid" : "54867dc55b482b04da7f23d8",  
> > "usId" : "54867dc55b482b04da7f23d7",  
> > "ut" : "2015-02-18T20:37:10",  
> > "act" : "productlisting",  
> > "st" : "2015-02-18T15:07:46",  
> > "Filter" : "",  
> > "av" : "3.0.0.0",  
> > "ViewType" : "SmallSingleList",  
> > "os" : "Windows",  
> > "categoryid" : "home-kitchen-curtains-blinds"  
> > }
> > 
> > "properties" : {  
> > "uid" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "ViewType" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "usId" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "os" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "Sort" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "Filter" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "categoryid" : {  
> > "type" : "double"  
> > },  
> > "gt" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "ut" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "st" : {  
> > "format" : "dateOptionalTime",  
> > "type" : "date"  
> > },  
> > "act" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > },  
> > "av" : {  
> > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > "type" : "string"  
> > }  
> > }
> > 
> > A sample document and the index mappings above..
> > 
> > On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:
> > 
> > I don’t know without a concrete example.  
> > I’d say that if you map have a type number and you send "123" it could  
> > work.
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> > [http://elasticsearch.com/](http://elasticsearch.com/)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 19 févr. 2015 à 09:30, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > It was my mistake, the field I was trying to do an aggregation was mapped  
> > double, I assumed its a string, after seeing some sample documents with  
> > strings..
> > 
> > Why didn't es throw an error when I'm indexing docs with strings instead  
> > of double..?
> > 
> > On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:
> > 
> > Did you apply your analyzer to your mapping?
> > 
> > David
> > 
> > Le 19 févr. 2015 à 08:53, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > 
> > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > 
> > Posted in stack over flow as well..
> > 
> > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:
> > 
> > I wanted a custom analyzer that behaves exactly like not\_analyzed, except  
> > that fields are case insensitive..
> > 
> > I have my analyzer as below,
> > 
> > ```
> > "index": {
> > "analysis": {
> > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > "case_insensitive_keyword_analyzer": {
> > "tokenizer": "keyword",
> > "filter": "lowercase"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > 
> > {  
> > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > "status" : 500  
> > }
> > 
> > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > 
> > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit https: [https://groups.google.com/d/optout](https://groups.google.com/d/optout)
> > 
> > ...
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/eeeaed55-c0e6-4b72-8401-6a20d6f12d0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eeeaed55-c0e6-4b72-8401-6a20d6f12d0c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 10, 2015, 1:30pm UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/12 "2015-03-10T13:30:25Z")

</div>

I'm going to make sure you get an answer soonish.

Best.

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

> Le 10 mars 2015 à 03:18, Anil Karaka [anilkaraka@gmail.com](mailto:anilkaraka@gmail.com) a écrit :
> 
> Hello David,
> 
> Currently we are using Elasticsearch in production to support heavy aggregation queries. It was working fine, but recently data nodes keep leaving the cluster regularly.. Each node around 3-5 times a day. And the scary part is cluster is in red state for few minutes each day. We tried changing the Garbage collector, to G1GC to prevent stop-the-world garbage collection state. But it still keeps happening. Nodes keep leaving and rejoining the cluster.
> 
> We will need some help in fixing our current issues.. Even though nodes are leaving and rejoining the cluster, we are only missing around 1000 documents out of around 10 million documents per day during indexing.. Still we need to address this issue.
> 
> And in addition to that we are going to face some scaling issues in near future. We want some production support to validate our current cluster setup, shard/replica settings, and indexing settings, not to mention cost savings.
> 
> I sent the same message on the [elasticsearch.org](http://elasticsearch.org) webpage, and am still waiting for their response. How do we approach elasticsearch support?
> 
> Thank you.
> 
> > On Thursday, February 19, 2015 at 2:34:14 PM UTC+5:30, David Pilato wrote:  
> > If you can provide a full example working as I did, we can try it and see what is wrong.
> > 
> > --  
> > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > @dadoonet | @elasticsearchfr | @scrutmydocs
> > 
> > > Le 19 févr. 2015 à 10:01, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > > 
> > > I"m getting this error as well using your PUT requests..
> > > 
> > > It feels like I'm doing something wrong.. But I don't know what exactly..
> > > 
> > > I'm using this index template.. [default index template with all default settings for snapdeal cluster · GitHub](https://gist.github.com/syllogismos/c2dde4f097fea149e1a0)
> > > 
> > > I didn't specify a particular mapping from my index but reindexed from a previous index.. and ended up with that mapping and documents that looks like above.. Am I seeing things and an obvious mistake? So lost right now..
> > > 
> > > > On Thursday, February 19, 2015 at 2:23:10 PM UTC+5:30, David Pilato wrote:  
> > > > I think you are doing something wrong.
> > > > 
> > > > DELETE index  
> > > > PUT index  
> > > > {  
> > > > "mappings": {  
> > > > "doc": {  
> > > > "properties": {  
> > > > "foo": {  
> > > > "type": "double"  
> > > > }  
> > > > }  
> > > > }  
> > > > }  
> > > > }  
> > > > PUT index/doc/1  
> > > > {  
> > > > "foo": "bar"  
> > > > }
> > > > 
> > > > gives:
> > > > 
> > > > {  
> > > > "error": "MapperParsingException[failed to parse [foo]]; nested: NumberFormatException[For input string: "bar"]; ",  
> > > > "status": 400  
> > > > }
> > > > 
> > > > --  
> > > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > > @dadoonet | @elasticsearchfr | @scrutmydocs
> > > > 
> > > > Le 19 févr. 2015 à 09:39, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > > > 
> > > > "\_source" : {  
> > > > "Sort" : "",  
> > > > "gt" : "2015-02-18T15:07:10",  
> > > > "uid" : "54867dc55b482b04da7f23d8",  
> > > > "usId" : "54867dc55b482b04da7f23d7",  
> > > > "ut" : "2015-02-18T20:37:10",  
> > > > "act" : "productlisting",  
> > > > "st" : "2015-02-18T15:07:46",  
> > > > "Filter" : "",  
> > > > "av" : "3.0.0.0",  
> > > > "ViewType" : "SmallSingleList",  
> > > > "os" : "Windows",  
> > > > "categoryid" : "home-kitchen-curtains-blinds"  
> > > > }
> > > > 
> > > > "properties" : {  
> > > > "uid" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "ViewType" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "usId" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "os" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "Sort" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "Filter" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "categoryid" : {  
> > > > "type" : "double"  
> > > > },  
> > > > "gt" : {  
> > > > "format" : "dateOptionalTime",  
> > > > "type" : "date"  
> > > > },  
> > > > "ut" : {  
> > > > "format" : "dateOptionalTime",  
> > > > "type" : "date"  
> > > > },  
> > > > "st" : {  
> > > > "format" : "dateOptionalTime",  
> > > > "type" : "date"  
> > > > },  
> > > > "act" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > },  
> > > > "av" : {  
> > > > "analyzer" : "case\_insensitive\_keyword\_analyzer",  
> > > > "type" : "string"  
> > > > }  
> > > > }
> > > > 
> > > > A sample document and the index mappings above..
> > > > 
> > > > On Thursday, February 19, 2015 at 2:03:11 PM UTC+5:30, David Pilato wrote:  
> > > > I don’t know without a concrete example.  
> > > > I’d say that if you map have a type number and you send "123" it could work.
> > > > 
> > > > --  
> > > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > > @dadoonet | @elasticsearchfr | @scrutmydocs
> > > > 
> > > > Le 19 févr. 2015 à 09:30, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > > > 
> > > > It was my mistake, the field I was trying to do an aggregation was mapped double, I assumed its a string, after seeing some sample documents with strings..
> > > > 
> > > > Why didn't es throw an error when I'm indexing docs with strings instead of double..?
> > > > 
> > > > On Thursday, February 19, 2015 at 1:35:08 PM UTC+5:30, David Pilato wrote:  
> > > > Did you apply your analyzer to your mapping?
> > > > 
> > > > David
> > > > 
> > > > Le 19 févr. 2015 à 08:53, Anil Karaka [anilk...@gmail.com](mailto:anilk...@gmail.com) a écrit :
> > > > 
> > > > [tokenize - Terms aggregation failing on string fields with a custom analyzer in elasticsearch - Stack Overflow](http://stackoverflow.com/questions/28601082/terms-aggregation-failing-on-string-fields-with-a-custom-analyzer-in-elasticsear)
> > > > 
> > > > Posted in stack over flow as well..
> > > > 
> > > > On Thursday, February 19, 2015 at 1:01:40 PM UTC+5:30, Anil Karaka wrote:  
> > > > I wanted a custom analyzer that behaves exactly like not\_analyzed, except that fields are case insensitive..
> > > > 
> > > > I have my analyzer as below,
> > > > 
> > > > ```
> > > > "index": {
> > > > "analysis": {
> > > > "analyzer": { // Custom Analyzer with keyword tokenizer and lowercase filter, same as not_analyzed but case insensitive
> > > > "case_insensitive_keyword_analyzer": {
> > > > "tokenizer": "keyword",
> > > > "filter": "lowercase"
> > > > }
> > > > }
> > > > }
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > But when I'm trying to do term aggregation over a field with strings analyzed as above, I'm getting this error..
> > > > 
> > > > {  
> > > > "error" :"ClassCastException[org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms$Bucket cannot be cast to org.elasticsearch.search.aggregations.bucket.terms.StringTerms$Bucket]",  
> > > > "status" : 500  
> > > > }
> > > > 
> > > > Are there additional settings that I have to update in my custom analyzer for my terms aggregation to work..?
> > > > 
> > > > The better question is I want a custom analyzer that does everything similar to not\_analyzed but is case insensitive.. How do I achieve that?
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91eea272-2f5e-4d9a-b975-dae5d50cd0d3%40googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46135e6f-6946-41bd-a562-557737192a07%40googlegroups.com).  
> > > > For more options, visit https:  
> > > > ...
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/260c8a9f-b80a-44af-827d-221e1cfc17e1%40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/eeeaed55-c0e6-4b72-8401-6a20d6f12d0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eeeaed55-c0e6-4b72-8401-6a20d6f12d0c%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/2EF181C4-29FC-46CE-A1CC-5D945205CA0D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/2EF181C4-29FC-46CE-A1CC-5D945205CA0D%40pilato.fr).  
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, 12:27am UTC](https://discuss.elastic.co/t/aggregations-failing-on-fields-with-custom-analyzer/22259/13 "2017-07-06T00:27:37Z")

</div>


