Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Latest
Describe the issue:
The null_value is configured however the field is not populated when the document is sent without the field.
Configuration:
PUT my-index-01/
{
"mappings": {
"dynamic": false,
"properties": {
"is_active": {
"type": "boolean",
"null_value": "false"
}
}
}
}
POST my-index-01/_doc/2
{
"keywords" : "test"
}
GET my-index-01/_search
{
"query": {
"match": {
"is_active": "false"
}
}
}
Figured that setting null_value is not same as setting default value.
Related -
Alternative is set the value to null in the indexing service. The following works alright -
PUT my-index-01/
{
"mappings": {
"dynamic": false,
"properties": {
"is_active": {
"type": "boolean",
"null_value": "false"
}
}
}
}
POST my-index-01/_doc/2
{
"keywords" : "test",
"is_active" : null
}
GET my-index-01/_search
{
"query": {
"match": {
"is_active": "false"
}
}
}