Skip to content
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

Default fuzzy transpositions to true #9278

Closed
grmblfrz opened this issue Jan 13, 2015 · 6 comments
Closed

Default fuzzy transpositions to true #9278

grmblfrz opened this issue Jan 13, 2015 · 6 comments
Assignees
Labels
>enhancement good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories v2.0.0-beta1

Comments

@grmblfrz
Copy link

The documentation states:

0..1:: must match exactly
1..4:: one edit allowed
>4:: two edits allowed

whereas the source contains:

final int len = termLen(text);
if (len <= 2) {
    return 0;
} else if (len > 5) {
    return 2;
} else {
    return 1;
}

For backwards compatibility the documentation should be adapted to:

0..1:: must match exactly
1..5:: one edit allowed
>5:: two edits allowed

(though I personally would prefer to change the implementation - then 'Flyod' would match 'Floyd' with fuzziness 'AUTO', now I'm needing fuzziness 2)

@clintongormley
Copy link

Hi @grmblfrz

Thanks for spotting this.

(though I personally would prefer to change the implementation - then 'Flyod' would match 'Floyd' with fuzziness 'AUTO', now I'm needing fuzziness 2)

Actually, you can set fuzzy_transpositions to true, which will mean that swapping yo is a single step:

DELETE t

PUT /t/t/1
{
  "text": "Floyd"
}

GET /_search
{
  "query": {
    "match": {
      "text": {
        "query": "flyod",
        "fuzziness": 1,
        "fuzzy_transpositions": true
      }
    }
  }
}

So I wonder if the right thing is to change the cutoff from 5 to 4, or to default to fuzzy transpositions?

@clintongormley
Copy link

@mikemccand any thoughts on this?

@mikemccand
Copy link
Contributor

+1 to default to fuzzy_transpositions = true.

A cutoff for 4 to allow 2 edits seems a bit too eager...

@clintongormley clintongormley changed the title documentation glitch for "fuzziness"="AUTO" Default fuzzy transpositions to true Jan 16, 2015
clintongormley added a commit that referenced this issue Jan 16, 2015
Corrected explanation of fuzzy AUTO

Related to #9278
clintongormley added a commit that referenced this issue Jan 16, 2015
Corrected explanation of fuzzy AUTO

Related to #9278
clintongormley added a commit that referenced this issue Jan 16, 2015
Corrected explanation of fuzzy AUTO

Related to #9278
@clintongormley
Copy link

I've updated the docs to correct the string lengths, and changed this issue to set fuzzy transpositions to true by default

@grmblfrz
Copy link
Author

Please document the fuzzy_transpositions parameter, I did not know about it before and could not find anything in the documentation.

@clintongormley clintongormley added the good first issue low hanging fruit label Jun 7, 2015
@clintongormley clintongormley removed the help wanted adoptme label Jul 2, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Corrected explanation of fuzzy AUTO

Related to elastic#9278
@devinrsmith
Copy link

I also don't see documentation around "fuzzy_transpositions", nor do I see the ability to set it in the java client code.

@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories v2.0.0-beta1
Projects
None yet
Development

No branches or pull requests

5 participants