"_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 <https://twitter.com/dadoonet> | @elasticsearchfr 
> <https://twitter.com/elasticsearchfr> | @scrutmydocs 
> <https://twitter.com/scrutmydocs>
>
>
>  
> Le 19 févr. 2015 à 09:30, Anil Karaka <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> a écrit :
>>
>>
>> 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.
>> 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?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit 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 <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?utm_medium=email&utm_source=footer>
> .
> For more options, visit 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/0aad0314-224f-4bc7-a223-7c9908823c61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to