I am using Elasticsearch 6.2 Version. In the aggregation, query results are returned like `
Apple 10, apple 20, aPple 30
But I need all the names to be lower case and the final count will be
apple 60
Is there any way to get the aggregation results like my requirement.
dadoonet
(David Pilato)
May 15, 2018, 12:42pm
2
Use a lowercase normalizer on your keyword field.
This is mappings file:
"company_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
},
},
"boost": 1.0,
"analyzer": "lowercase_analyzer",
},
dadoonet
(David Pilato)
May 15, 2018, 1:25pm
4
@dadoonet It is working fine. Thank you!
In my case, I am having some special characters also like below:
Token - count
apple, inc - 20
apple inc - 10
apple inc, - 10
apple. inc - 20
apple.inc., - 10
I need the output like this:
Token - count
apple inc - 70
Is there any analyzer to satisfy my condition? If yes, Can you point me? Thank you!
@dadoonet Got it. Just used custom analyzer and used that analyzer in normalize function.
"dot_pattern": {
"type": "pattern_replace",
"pattern": "\.",
"replacement": " "
}
system
(system)
Closed
June 12, 2018, 1:47pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.