I have an index defined like this:
PUT /fuzzytest
{
"settings": {
"index": {
"number_of_shards": "1",
"analysis": {
"filter": {
"my_word_delimiter": {
"type": "word_delimiter",
"preserve_original": "true",
"catenate_numbers": "true",
"catenate_words": "true",
"catenate_all": "true"
}
},
"analyzer": {
"my_identifier_analyzer": {
"filter": [
"standard",
"my_word_delimiter",
"lowercase"
],
"tokenizer": "keyword"
}
}
}
}
},
"mappings": {
"tip": {
"properties": {
"code": {
"type": "string",
"analyzer": "my_identifier_analyzer"
}
}
}
}
}
I put this document:
PUT fuzzytest/tip/1
{
"code": "335/25R20"
}
If I search it without fuzzy, I find it:
POST fuzzytest/_search
{
"query" : {
"query_string" : {
"query" : "25r20",
"fields" : [ "code" ]
}
}
}
But if I append the ~2
, for fuzzy, I get no results.
POST fuzzytest/_search
{
"query" : {
"query_string" : {
"query" : "25r20~2",
"fields" : [ "code" ]
}
}
}
My question is why the last search doesn't bring any result, while the first one brings.