Completion field type
To use the completion suggester, map the field from which you want to generate suggestions as type completion. This indexes the field values for fast completions.
resp = client.indices.create(
index="music",
mappings={
"properties": {
"suggest": {
"type": "completion"
}
}
},
)
print(resp) response = client.indices.create(
index: 'music',
body: {
mappings: {
properties: {
suggest: {
type: 'completion'
}
}
}
}
)
puts response const response = await client.indices.create({
index: "music",
mappings: {
properties: {
suggest: {
type: "completion",
},
},
},
});
console.log(response); PUT music
{
"mappings": {
"properties": {
"suggest": {
"type": "completion"
}
}
}
} Parameters for completion fields
The following parameters are accepted by completion fields:
| The index analyzer to use, defaults to | |
| The search analyzer to use, defaults to value of | |
| | Preserves the separators, defaults to |
| | Enables position increments, defaults to |
| | Limits the length of a single input, defaults to |
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/completion.html