Completion field type
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 |