# Aggregating full text fields

**URL:** <https://discuss.elastic.co/t/aggregating-full-text-fields/89475>\
**Category:** Elasticsearch\
**Created:** [June 14, 2017, 11:52pm UTC](https://discuss.elastic.co/t/aggregating-full-text-fields/89475 "2017-06-14T23:52:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamA](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@SamA](https://discuss.elastic.co/u/SamA)\
**Post date:** [June 14, 2017, 11:52pm UTC](https://discuss.elastic.co/t/aggregating-full-text-fields/89475/1 "2017-06-14T23:52:39Z")

</div>

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:

```
"aggs":{
  "group_by_market":{
    "terms":{
      "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

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 12, 2017, 11:53pm UTC](https://discuss.elastic.co/t/aggregating-full-text-fields/89475/2 "2017-07-12T23:53:00Z")

</div>

Closed on July 12, 2017, 11:53pm UTC

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