Fuzziness AUTO doesn't work as expected

Hi,

I'm currently having some issues with a search that's using Fuzziness.AUTO.

First a remark on how AUTO is documented, the documentation says:

"For lengths: 0..1 must match exactly, 1..4 one edit allowed, >4 two edits
allowed". That is a bit ambigue, how is a term with length 1 treated? I'm
guessing it has to match, but the documentation could be interpreted
otherwise. And what exactly would a term of length 0 be?

Now to my problem: I have an index containing a field that has information
like street addresses in it, e.g. "Somestreet 38", now I want a fuzzy match
query (with operator AND) for "somestreet 39" or "somestreet 38a" to match
the document with a field value of "Somestreet 38". This works with the
fuzziness of the query set to 1 or 2, but not with AUTO. "38" and "39"
should both be terms with length 2, and their edit distance should be 1,
right? So according to the documentation quoted above, the query should
match.

To reproduce, create index and example document with:

curl -XPUT 'localhost:9200/addresses?pretty'
curl -XPUT 'localhost:9200/addresses/sometype/1?pretty' -d '
{
"street": "Somestreet 38"
}'

The following query should have one match, but doesn't:

curl -XGET 'localhost:9200/addresses/_search?pretty' -d '
{
"query" : {
"match" : {
"street" : {
"query" : "somestreet 39",
"operator" : "and",
"fuzziness" : "AUTO"
}
}
}
}'

If you change the fuzziness to "1" or "2", the query correctly returns one
hit.

Is my interpretation of the docs off or is the implementation of AUTO
inconsistent with the docs?

Cheers,
David

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/49eff5ba-8e23-470d-bc23-501c934a88ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

On Friday, September 26, 2014 5:22:49 PM UTC+2, David Klotz wrote:

I'm currently having some issues with a search that's using Fuzziness.AUTO.
[...]
Is my interpretation of the docs off or is the implementation of AUTO
inconsistent with the docs?

to make the implicit question of my original post more explicit: How can I
achieve the documented behavior of fuzziness: "AUTO", i.e. a fuzzy search
that allows zero edits in terms of length one, one edit in terms of length

= two and two edits only in terms of length five and above?

Cheers,
David

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8e10c0c9-9a77-4214-a406-5c329249c85a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.