New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit distance allowed values for fuzzy_like_this query #5292

Closed
dnavre opened this Issue Feb 28, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@dnavre

dnavre commented Feb 28, 2014

The doc here says http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

Note: in all APIs except for the Fuzzy Like This Query, the maximum allowed edit distance is 2.

However when one tries to do this in Java API:

fuzzyLikeThisQuery(fieldName).likeText(searchString).fuzziness(Fuzziness.fromEdits(4));

An exception is thrown from the Fuzziness.fromEdits(4) method call

org.elasticsearch.ElasticsearchIllegalArgumentException: Valid edit distances are [0, 1, 2] but was [4]

We thought that maybe this is a bug in the Java API and tried the same thing with the REST API. The query was this:

{
        "flt": {
            "fields": [
            "comment"
        ],
        "like_text": "FFFdfds",
        "fuzziness": "4"
    }
}

the result was this:

ElasticsearchIllegalArgumentException[Can't get similarity from fuzziness [4]]; }]

But the query works fro values 1 and 2.
So I guess either the documentation is mistaken or the implementation. We were previously using the edit distances of up to 4-5 characters. After the update we're kind of lost for now :)

@s1monw s1monw self-assigned this Feb 28, 2014

@s1monw

This comment has been minimized.

Show comment
Hide comment
@s1monw

s1monw Feb 28, 2014

Contributor

I will look into this - thanks for opening it

Contributor

s1monw commented Feb 28, 2014

I will look into this - thanks for opening it

@dnavre

This comment has been minimized.

Show comment
Hide comment
@dnavre

dnavre Mar 5, 2014

thank you for looking into this :) We're currently being late for a release date cause of this issue. Can you please tell us if we should expect any news on this in the near future?

Thanks once more

dnavre commented Mar 5, 2014

thank you for looking into this :) We're currently being late for a release date cause of this issue. Can you please tell us if we should expect any news on this in the near future?

Thanks once more

@s1monw s1monw added v1.0.2 and removed v0.90.13 labels Mar 10, 2014

@s1monw

This comment has been minimized.

Show comment
Hide comment
@s1monw

s1monw Mar 10, 2014

Contributor

hey @dnavre a fix for this will be in the next release.. thanks for you patience

Contributor

s1monw commented Mar 10, 2014

hey @dnavre a fix for this will be in the next release.. thanks for you patience

@s1monw s1monw added the bug label Mar 12, 2014

s1monw added a commit that referenced this issue Mar 13, 2014

Allow edit distances > 2 on FuzzyLikeThisQuery
Due to a regression edit distances > 2 threw exceptions after unifying
the fuzziness factor in Elasticsearch `1.0`. This commit brings back the
expceted behavior.

Closes #5292

s1monw added a commit that referenced this issue Mar 13, 2014

Allow edit distances > 2 on FuzzyLikeThisQuery
Due to a regression edit distances > 2 threw exceptions after unifying
the fuzziness factor in Elasticsearch `1.0`. This commit brings back the
expceted behavior.

Closes #5292

@s1monw s1monw closed this in 8a1e77c Mar 13, 2014

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Allow edit distances > 2 on FuzzyLikeThisQuery
Due to a regression edit distances > 2 threw exceptions after unifying
the fuzziness factor in Elasticsearch `1.0`. This commit brings back the
expceted behavior.

Closes elastic#5292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment