# Perform Group By - Exact String

**URL:** <https://discuss.elastic.co/t/perform-group-by-exact-string/24463>\
**Category:** Elasticsearch\
**Created:** [June 26, 2015, 8:37pm UTC](https://discuss.elastic.co/t/perform-group-by-exact-string/24463 "2015-06-26T20:37:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [June 26, 2015, 8:37pm UTC](https://discuss.elastic.co/t/perform-group-by-exact-string/24463/1 "2015-06-26T20:37:33Z")

</div>

Hi,

I am trying to perform group by on a string field. But as I understand, strings are tokenized and hence not able group by on the exact string. I found that it has to do with analyzer.  
Is there a way I can do that?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 26, 2015, 9:38pm UTC](https://discuss.elastic.co/t/perform-group-by-exact-string/24463/2 "2015-06-26T21:38:37Z")

</div>

You don't have to have String fields analized. Check out the dynamic fields

You'll have to read up on mappings but here is what you will be looking for

[https://www.elastic.co/guide/en/elasticsearch/reference/current/\_multi\_fields.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/_multi_fields.html)

You can set a field to Not be analyzed , or you can create an additional field so you can have a tokenized field or "raw" field

---

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [June 26, 2015, 9:42pm UTC](https://discuss.elastic.co/t/perform-group-by-exact-string/24463/3 "2015-06-26T21:42:19Z")

</div>

Yeah, I have about this earlier.  
I haven't modified any mappings.  
I used Logstash to load the logs into Elasticsearch. But now realized that I can't do a multi-field aggregation or exact string search.  
So, do I have to reload the data for this to work now?

---

<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 6, 2017, 12:05am UTC](https://discuss.elastic.co/t/perform-group-by-exact-string/24463/4 "2017-07-06T00:05:03Z")

</div>


