Yeah, I saw that there was no mapping recognized when i GET phone
but one was hardcoded nervertheless. I didn't let ES do the mapping for me, I just saw that it ignore my mapping and put one by itself.
Anyway, I broke my index in two part, one where I put the settings filled with the char_filter and the tokenizer composing the analyzer, and one with the mapping (in this order, it doesn't work the other way since I call an analyzer that's not declared yet, in the mapping).
And the GET phone
is good this time. It show my mapping. I don't know why it didn't appear earlier.
But still; my data won't get analyzed.
Here the split index :
PUT phone
{ "settings": {
"analysis": {
"char_filter": {
"my_char_filter": {
"type": "mapping",
"mappings": [
"( => ",
") => ",
", => ",
". => ",
"; => ",
"\\u0020 => ",
"+ => 00"
]
}
},
"tokenizer": {
"two": {
"type": "ngram",
"min_gram": 3,
"max_gram": 4
}
},
"analyzer": {
"one": {
"tokenizer": "two",
"char_filter": [
"my_char_filter"]
}
}
}
}}
PUT phone/_mapping/_doc
{
"properties": {
"phone_number": {
"type": "text",
"analyzer": "one"},
"favoris": {
"type":"boolean"}}
}
and the answer for the GET phone
command:
{
"phone": {
"aliases": {},
"mappings": {
"_doc": {
"properties": {
"favoris": {
"type": "boolean"
},
"phone_number": {
"type": "text",
"analyzer": "one"
}
}
}
},
"settings": {
"index": {
"number_of_shards": "5",
"provided_name": "phone",
"creation_date": "1522240891958",
"analysis": {
"analyzer": {
"one": {
"char_filter": [
"my_char_filter"
],
"tokenizer": "two"
}
},
"char_filter": {
"my_char_filter": {
"type": "mapping",
"mappings": [
"( => ",
") => ",
", => ",
". => ",
"; => ",
"\\u0020 => ",
"+ => 00"
]
}
},
"tokenizer": {
"two": {
"type": "ngram",
"min_gram": "3",
"max_gram": "4"
}
}
},
"number_of_replicas": "1",
"uuid": "tEKKrMe7Qu2TKXlPzzCm-Q",
"version": {
"created": "6020299"
}
}
}
}
}
I don't think I'm far from it, I just probably missed a part where I should better declare things.