How to do aggregation in Elastic search with a field which has both keyword and text types

Im new to ES, Please help me to do the aggregation in Elastic search with a field which has both keyword and text types.

A single field can not have multiple types. If you are referring to the default mapping that uses multifields, there are two separate fields that can be queried and aggregated on - <field> and <field>.keyword. Pick the one that has the mapping you need for your serach or aggregation.