I'm trying to work on a basic suggester that if someone write "bl" the suggester would propose "blue corola" and "toyota blue". But at the moment its only return "blue corola". It's like the analyser dont work.
Can you help me to find what I am missing
PUT /my-index-000001
{
"settings": {
"analysis": {
"analyzer": {
"custom_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": ["lowercase"]
}
}
}
},
"mappings": {
"properties": {
"color": {
"type": "completion",
"analyzer": "custom_analyzer",
"search_analyzer": "standard"
}
}
}
}
POST /my-index-000001/_doc/1
{
"color": ["toyota blue"]
}
POST /my-index-000001/_doc/2
{
"color": ["toyota blue"]
}
POST /my-index-000001/_doc/3
{
"color": ["blue corola"]
}
POST /my-index-000001/_search
{
"suggest": {
"my-suggestion": {
"text": "bl",
"completion": {
"field": "color",
"skip_duplicates": "false"
}
}
}
}