# Fuzzy Aggregations

**URL:** https://discuss.elastic.co/t/fuzzy-aggregations/84067
**Category:** Elasticsearch
**Created:** [April 28, 2017, 10:40pm UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067 "2017-04-28T22:40:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Michael\_Sander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_sander/32/838_2.png) [@Michael\_Sander](https://discuss.elastic.co/u/Michael_Sander)
#### Post date: [April 28, 2017, 10:40pm UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067/1 "2017-04-28T22:40:57Z")

</div>

Elasticsearch supports [fuzzy search queries](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/fuzzy-match-query.html) and [term aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html).

I am not aware of any way to do fuzzy aggregations, but it would be a great feature. My database deals with names, misspellings are rampant. It would be great if "Brian Smith" was put into the same bucket as "Brain Smith".

If this is not possible today, is it anywhere on the roadmap? Is it even technically feasible?

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [April 29, 2017, 8:11am UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067/2 "2017-04-29T08:11:41Z")

</div>

I've built data linking systems before and a general issue with use of any fuzzy matching on large sets (such as aggregations) is that the iterative nature of linking the data means that little errors get amplified like feedback noise between a pa and mic. 'Mark' might match 'Marc' which might then join with 'Marcy' and then 'Macy'. Entities just snowball.  
Each name needs additional context to prevent this. A postcode, a date of birth, a vehicle reg plate. Names on their own are not enough and entities need to hold a rich mix of identifiers for error- free linking. This requires a much more complex system

---

<div class="post-metadata">

### Author: ![Michael\_Sander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_sander/32/838_2.png) [@Michael\_Sander](https://discuss.elastic.co/u/Michael_Sander)
#### Post date: [May 2, 2017, 12:26am UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067/3 "2017-05-02T00:26:18Z")

</div>

Why couldn't it be setup such that: for every entity returned in a bucket, also return all entities that are within 1 edit distance away. That way the bucket "Mark" will catch "Marc", but not "Marcy". However, the bucket "Marc" would also catch "Mark" and "Marcy".

This sounds like a difficult system to build and run at scale, but perhaps possible.

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [May 2, 2017, 7:06am UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067/4 "2017-05-02T07:06:31Z")

</div>

"Jon" would match "Joan" but not "Jonathon"

Name matching is a specialist topic and frequently backed by synonym databases (see [http://www.basistech.com/text-analytics/rosette/name-indexer/](http://www.basistech.com/text-analytics/rosette/name-indexer/) ).

My experience is that effective entity resolution relies on using added context e.g. Zip codes or phone numbers alongside names.

---

<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: [May 30, 2017, 7:21am UTC](https://discuss.elastic.co/t/fuzzy-aggregations/84067/5 "2017-05-30T07:21:18Z")

</div>

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