Compare two columns with fuzziness or slops

Hi,
I'm trying to compare two columns such as address1 and address2, but also want to apply fuzziness or slop values. I could get the exact match in the following in Kibana.

GET /my_index/_search
{
"query": {
"bool": {
"must": [
{
"script": {
"script": "doc['address1.keyword'].value==doc['address2.keyword'].value"
}
}
]
}
}
}

But I couldn't apply fuzziness or slop values on script.
Is there any (better) way to perform this task?

Thanks

that is not really possible with access doc values, as you cannot execute another analysis and search step after receiving those values.

Can you explain, what exactly is your use-case? Maybe there is another way to work this out, but I am totally lacking context and I am curious to know more :slight_smile:

Let's say I have a table whose two fields are address1 and address2. Not only that I want to find out how many times these two fields are exactly the same, but also (more importantly) when they are different, I want to find if they can be considered the same using fuzziness or slop values.
Ex: "Adam Street" vs "Adams Street" using fuzziness=1, "Adam Street" vs "Street Adam" using slop=2.
Any advice would be appreciated.
Thanks

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