Elasticsearch Fuzzy Search does not work sometimes for correctly spelled words

I'm working on FTS feature in our product. Everything has been going smoothly until today. One of our clients complains that if he enters a full and correctly spelled word (e.g. 'important') then the search returns no results, but if he enters e.g. 'importan' then it works perfectly. Our implementation should support the Fuzzy Search and I guess that's the reason why we have this issue.

http://localhost:9200/content-en/_search?q=title:Important~ request returns no results. http://localhost:9200/content-en/_search?q=title:Importan~ works fine.

As you may see, I add '~' character to all words from user's input to enable fuzzy search. It looks very odd, because for correctly spelled words so called Levenstein distance is equal to 0 and 0 < 2 obviously.

Here are the index settings:
{
"content-en": {
"aliases": {

    },
    "mappings": {
      "content": {
        "properties": {
          "accountId": {
            "type": "integer"
          },
          "bodyText": {
            "type": "text",
            "analyzer": "english-nohtml"
          },
          "cultureId": {
            "type": "integer"
          },
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "text",
            "analyzer": "english"
          }
        }
      }
    },
    "settings": {
      "index": {
        "number_of_shards": "1",
        "provided_name": "content-en",
        "creation_date": "1512485763011",
        "analysis": {
          "filter": {
            "english_keywords": {
              "keywords": [
                "example"
              ],
              "type": "keyword_marker"
            },
            "english_stemmer": {
              "type": "stemmer",
              "language": "english"
            },
            "english_possessive_stemmer": {
              "type": "stemmer",
              "language": "possessive_english"
            },
            "phonetic": {
              "type": "phonetic",
              "encoder": "beidermorse"
            },
            "english_stop": {
              "type": "stop",
              "stopwords": [
                "_english_"
              ]
            }
          },
          "analyzer": {
            "english-nohtml": {
              "filter": [
                "lowercase",
                "english_stop",
                "english_keywords",
                "english_stemmer",
                "english_possessive_stemmer",
                "phonetic"
              ],
              "char_filter": [
                "html_strip"
              ],
              "type": "custom",
              "tokenizer": "standard"
            }
          }
        },
        "number_of_replicas": "0",
        "uuid": "GW0TFz5URwqIL2TF362sgA",
        "version": {
          "created": "5050099"
        }
      }
    }
  }
}

That "english-nohtml" is just a custom analyzer and it is not used for the 'Title' field I mentioned in my test requests, so it can't cause the issue.

One of the indexed documents:
{
"_index": "content-en",
"_type": "content",
"_id": "25404",
"_score": 4.977446,
"_source":
{
"id": 25404,
"accountId": 306,
"cultureId": 1,
"title": "Important Info ",
"bodyText": "

Communicate “need-to-know information and have staff members confirm they have read and understood the message.

"
}
}

Just FYI, the client app has been implemented in C# using NEST library. To run a search I use a 'QueryString' type of query, ES version is 5.5

Please advise. Thanks in advance.

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