Hi there,
I am using a edge ngram tokenizer in order to provide partial matching .
My scripts:
PUT docs
{
"settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"tokenizer": "autocomplete",
"filter": ["lowercase"]
},
"autocomplete_search": {
"tokenizer": "lowercase"
}
},
"tokenizer": {
"autocomplete": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 30,
"token_chars": [ "letter","digit","punctuation","symbol"]
}
}
}
},
"mappings": {
"doc": {
"properties": {
"name": {"type": "text","analyzer": "autocomplete","search_analyzer": "autocomplete_search"}
}
}
}
}
PUT docs/doc/1
{ "name" : "111"}
PUT docs/doc/2
{"name" : "first"}
PUT docs/doc/3
{"name" : "123456789й"}
PUT docs/doc/4
{"name" : "fir123"}
So, I expect I can find my documents(3 and 4) use next query:
GET docs/_search
{
"query": {
"match": {
"name": "12"
}
}
}
Also, I expect I can find my documents(2 and 4) use next query:
GET docs/_search
{
"query": {
"match": {
"name": "Fi"
}
}
}
What could be wrong?
Thanks!