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
How would you write this kind of query?