Edge ngram for numeric value

Hi,

I am implementing edge ngram on a text field for letters and digits. But it is not able to search numeric value.

My code is:

PUT my-index-00001
{
  "settings": {
    "analysis": {
      "analyzer": {
        "autocomplete": {
          "tokenizer": "autocomplete",
          "filter": [
            "lowercase"
          ]
        },
        "autocomplete_search": {
          "tokenizer": "lowercase"
        }
      },
      "tokenizer": {
        "autocomplete": {
          "type": "edge_ngram",
          "min_gram": 2,
          "max_gram": 10,
          "token_chars": [
            "letter",
            "digit"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "title": {
        "type": "text",
        "analyzer": "autocomplete",
        "search_analyzer": "autocomplete_search"
      }
    }
  }
}

I inserted this value:

PUT my-index-00001/_doc/1
{
  "title": "realtors 545768 hello" 
}

And I am searching by numeric value:

GET my-index-00001/_search
{
  "query": {
    "match": {
      "title": "54"
    }
  }
}

But no result.

Thanks

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