Aggregating full text fields

I'm trying to display the number of markets in an index. Each document has a field called market and I want aggregate the results like this:

"Advertising and sales" : 400

"Oil Industry" : 250

"Metal Industry" : 125
I know how to display these results using the query:

      "field": "market"

The problem is that when they are displayed; they don't get displayed correctly. The markets are displayed separately. For example:

"Advertising": 400

"Sales": 400

"Oil": 322

How do I make it so the markets are aggregated with all the text?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.