Hi,
I created an index that only contains the suggest property:
PUT /test
{
"mappings": {
"properties": {
"suggest": {
"type": "completion",
"analyzer": "standard",
"preserve_separators": false,
"preserve_position_increments": false,
"max_input_length": 30
}
}
}
}
POST _bulk
{"index": {"_index": "test", "_id": "1"}}
{"suggest":{"input":["ab"]}}
{"index": {"_index": "test", "_id": "2"}}
{"suggest":{"input":["a bc"]}}
{"index": {"_index": "test", "_id": "3"}}
{"suggest":{"input":["a bc1"]}}
{"index": {"_index": "test", "_id": "4"}}
{"suggest":{"input":["a b"]}}
My doc data (also in the order returned by suggest => "ab"):
a b
a bc
a bc1
ab
GET /test/_search
{
"suggest": {
"suggest": {
"completion": {
"field": "suggest",
"size": 100
},
"prefix": "ab"
}
}
}
When the weight is the same, the return result of completion is in lexicographical order. Why is the space not removed in this lexicographical order (considering "preserve_separators" : false )?
expected:
ab
a b
a bc
a bc123
or
a b
ab
a bc
a bc123
If it is possible, how should I configure the index?
Elasticsearch Version: 7.17.3
Thanks