Constant keyword field type
Introduced 2.14
A constant keyword field uses the same value for all documents in the index.
When a search request spans multiple indexes, you can filter on a constant keyword field to match documents from indexes with the given constant value but not from indexes with a different value.
Example
The following query creates a mapping with a constant keyword field:
PUT romcom_movies
{
"mappings" : {
"properties" : {
"genre" : {
"type": "constant_keyword",
"value" : "Romantic comedy"
}
}
}
}
copy
Parameters
The following table lists the parameters accepted by constant keyword field types. All values are required.
Parameter | Description |
---|---|
value | The string field value for all documents in the index. |
当前内容版权归 OpenSearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 OpenSearch .