# Aggregation for similar strings

**URL:** <https://discuss.elastic.co/t/aggregation-for-similar-strings/23578>\
**Category:** Elasticsearch\
**Created:** [May 6, 2015, 3:11pm UTC](https://discuss.elastic.co/t/aggregation-for-similar-strings/23578 "2015-05-06T15:11:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)\
**Post date:** [May 6, 2015, 3:11pm UTC](https://discuss.elastic.co/t/aggregation-for-similar-strings/23578/1 "2015-05-06T15:11:06Z")

</div>

hi guys,

i have similar string that i want to aggregate,  
but they seem to be different within few characters at the end.

for example:  
doc1: {"message":"hello world and good morning1 300"}  
doc2: {"message":"hello world and good morning1 200"}  
doc3: {"message":"hello world and good morning1 100"}

i would like to have this result in the aggregation:

"hello world and good morning1" - count: 3

the field currently defined with default analyzer

btw, is it possible to identify also more complected string such as:  
doc3: {"message":"500 hello world and good morning1 100"}

thanks a lot for advanced!

Lior

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7c402360-6940-400e-8a2f-933107f410a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c402360-6940-400e-8a2f-933107f410a1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:15am UTC](https://discuss.elastic.co/t/aggregation-for-similar-strings/23578/2 "2017-07-06T00:15:22Z")

</div>


