Field = field in a fuzzy query

Within elastic you can do a script search for if one field equals another field

doc['field1'].value = doc['field 2'].value

is there any way to do this where one of the values (doc['field1'].value) is the value used in a fuzzy query. Or a way to do a fuzzy query within painless?

Afraid not possible at the moment. Fuzzy is a fairly complex operation internally, which is only available through Lucene's querying framework. It's not available in Painless.

And the reason scripting isn't available on most queries is because most scripts don't touch doc values (unlike the scripted query). By pulling in doc values, it slows down the query drastically. So we keep scripts and doc values segregated to the script query.

You could probably implement a Levenshtein Distance algo in painless, but it'll be relatively expensive compared to Lucene's implementation (which utilizes pre-baked automata instead of recursive or iterative matrix algos)

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