# Elasticsearch fuzzy intersection of two arrays

**URL:** <https://discuss.elastic.co/t/elasticsearch-fuzzy-intersection-of-two-arrays/20706>\
**Category:** Elasticsearch\
**Created:** [November 12, 2014, 2:16pm UTC](https://discuss.elastic.co/t/elasticsearch-fuzzy-intersection-of-two-arrays/20706 "2014-11-12T14:16:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Fedorov](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Alex\_Fedorov](https://discuss.elastic.co/u/Alex_Fedorov)\
**Post date:** [November 12, 2014, 2:16pm UTC](https://discuss.elastic.co/t/elasticsearch-fuzzy-intersection-of-two-arrays/20706/1 "2014-11-12T14:16:02Z")

</div>

I have an object in the Elasticsearch index that has a nested object which  
is a list of strings.  
I would like to do the intersection against this list in both exact and  
fuzzy ways.  
So for example I have browser names with versions in the index like:  
"browsers": [{"name":"Chrome 38"}, {"name":"Firefox 32"}, {"name":"Safari  
5"}]

the request could be:  
[{"name":"Chrome 38"}, {"name":"IE 10"}]  
then I have just 1 exact match.

or another example:  
[{"name":"Chrome 39"}, {"name":"Firefox 33"}, {"name":"Safari 5"]  
here I have 2 fuzzy-matches(Levenstein=2) and 1 exact match

Those results which have more matches should be on top.  
How would you write this kind of query ?

--  
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/9d47a409-acc1-466d-99ba-47e264f68360%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d47a409-acc1-466d-99ba-47e264f68360%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:50am UTC](https://discuss.elastic.co/t/elasticsearch-fuzzy-intersection-of-two-arrays/20706/2 "2017-07-06T00:50:30Z")

</div>

Closed on July 6, 2017, 12:50am UTC


