Search code examples
node.jselasticsearchaggregateloopbackjsaggregation

Elastic search aggregation with a field which have both keyword and text type


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


Solution

  • You can run the aggregation on the keyword field. Ie field.keyword