Confusing results from fuzzy query (1 term, 1 field)

For a well formatted example, please
see: http://stackoverflow.com/questions/28161480/fuzzy-not-functioning-as-expected-one-term-search-see-example

Here's my problem:
Consider the following results from:

curl -XGET 'http://localhost:9200/megacorp/employee/_search' -d 
'{ "query" : 
     {"match":  
        {"last_name": "Smith"}
     }
  }'

Result:

{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 2,
    "max_score": 0.30685282,
    "hits": [
      {
        "_index": "megacorp",
        "_type": "employee",
        "_id": "1",
        "_score": 0.30685282,
        "_source": {
          "first_name": "John",
          "last_name": "Smith",
          "age": 25,
          "about": "I love to go rock climbing on the weekends.",
          "interests": [
            "sports",
            "music"
          ]
        }
      },
      {
        "_index": "megacorp",
        "_type": "employee",
        "_id": "2",
        "_score": 0.30685282,
        "_source": {
          "first_name": "Jane",
          "last_name": "Smith",
          "age": 25,
          "about": "I love to go rock climbing",
          "interests": [
            "sports",
            "music"
          ]
        }
      }
    ]
  }
}

Now when I execute the following query:

curl -XGET 'http://localhost:9200/megacorp/employee/_search' -d 
'{ "query" : 
        {"fuzzy": 
             {"last_name": 
                  {"value":"Smitt", 
                   "fuzziness": 1
                  }
              }
         }
 }'

Returns NO results despite the Levenshtein distance of "Smith" and "Smitt"
being 1. The same thing happens with a value of "Smit," (NB: the comma is
for grammatical purposes, it's not in the value) which also has a distance
of 1. If I put in a fuzziness value of 2, I get results. What am I
missing here?

--
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/0fe765b1-1bda-4459-8ee5-aeddc9f05727%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Looks like this was answered on StackOverflow?

Mike McCandless

http://blog.mikemccandless.com

On Mon, Jan 26, 2015 at 7:54 PM, Steve Pearlman slpearlman@gmail.com
wrote:

For a well formatted example, please see:
elasticsearch - Fuzzy not functioning as expected (one term search, see example) - Stack Overflow

Here's my problem:
Consider the following results from:

curl -XGET 'http://localhost:9200/megacorp/employee/_search' -d
'{ "query" :
     {"match":
        {"last_name": "Smith"}
     }
  }'

Result:

{
  "took": 3,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 2,
    "max_score": 0.30685282,
    "hits": [
      {
        "_index": "megacorp",
        "_type": "employee",
        "_id": "1",
        "_score": 0.30685282,
        "_source": {
          "first_name": "John",
          "last_name": "Smith",
          "age": 25,
          "about": "I love to go rock climbing on the weekends.",
          "interests": [
            "sports",
            "music"
          ]
        }
      },
      {
        "_index": "megacorp",
        "_type": "employee",
        "_id": "2",
        "_score": 0.30685282,
        "_source": {
          "first_name": "Jane",
          "last_name": "Smith",
          "age": 25,
          "about": "I love to go rock climbing",
          "interests": [
            "sports",
            "music"
          ]
        }
      }
    ]
  }
}

Now when I execute the following query:

curl -XGET 'http://localhost:9200/megacorp/employee/_search' -d
'{ "query" :
        {"fuzzy":
             {"last_name":
                  {"value":"Smitt",
                   "fuzziness": 1
                  }
              }
         }
 }'

Returns NO results despite the Levenshtein distance of "Smith" and "Smitt"
being 1. The same thing happens with a value of "Smit," (NB: the comma is
for grammatical purposes, it's not in the value) which also has a distance
of 1. If I put in a fuzziness value of 2, I get results. What am I
missing here?

--
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/0fe765b1-1bda-4459-8ee5-aeddc9f05727%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/0fe765b1-1bda-4459-8ee5-aeddc9f05727%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/CAD7smRe5cXGF_FesNGOxS4294c2yq8oagmqZ%2BxKYjKv1_wO5kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.