We are using Elasticsearch 7.5.10 and indexing data into this cluster via a Node.js application (client version: "@elastic/elasticsearch": "7.17"). My index mapping is as follows:
{
"platform.fund.notices.test_a": {
"aliases": {},
"mappings": {
"_source": {
"excludes": [
"_",
"deleteField",
"flag"
]
},
"properties": {
"COMPANYCODE": {
"type": "keyword"
},
"FWDT": {
"type": "date"
},
"Guid": {
"type": "keyword"
},
"NW1303_001": {
"type": "text",
"analyzer": "contain"
},
"NW1303_007": {
"type": "keyword",
"index": false
},
"NW1303_008": {
"type": "keyword"
},
"NW1303_009": {
"type": "keyword"
},
"NW1313_002": {
"type": "text",
"index": false
},
"NW1313_004": {
"type": "keyword",
"doc_values": false
},
"NW1313_005": {
"type": "keyword",
"index": false
},
"PUBISHDATE": {
"type": "date",
"format": "yyyy-MM-dd||yyyyMMdd"
},
"_": {
"type": "keyword",
"index": false
},
"attachList": {
"properties": {
"DD0031_004": {
"type": "keyword"
},
"DD0031_008": {
"type": "keyword",
"index": false
}
}
},
"flag": {
"type": "byte",
"index": false
},
"id": {
"type": "keyword"
},
"noticeDate": {
"type": "date",
"format": "yyyy-MM-dd||yyyyMMdd"
},
"tNW1303": {
"type": "nested",
"properties": {
"CO": {
"type": "keyword"
},
"DD9205_002": {
"type": "keyword",
"index": false
},
"FinfoID": {
"type": "keyword"
},
"SYMBOL": {
"type": "keyword"
},
"TRCode": {
"type": "keyword"
},
"fund_type": {
"type": "keyword"
},
"fund_type2": {
"type": "keyword"
},
"tNW1303_id": {
"type": "keyword"
}
}
},
"typeList": {
"properties": {
"NW1303_005": {
"type": "keyword"
},
"NW1303_006": {
"type": "keyword",
"index": false
}
}
}
}
},
"settings": {
"index": {
"max_ngram_diff": "29",
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"refresh_interval": "-1",
"number_of_shards": "3",
"provided_name": "platform.fund.notices.test_a",
"creation_date": "1761642015631",
"analysis": {
"analyzer": {
"contain": {
"stopwords": "_none_",
"tokenizer": "contain"
}
},
"tokenizer": {
"contain": {
"token_chars": [
"letter",
"digit",
"punctuation"
],
"min_gram": "1",
"type": "ngram",
"max_gram": "3"
}
}
},
"number_of_replicas": "1",
"uuid": "FzR_Lx-hTY2pOVXCUWADXg",
"version": {
"created": "7100299"
}
}
}
}
}
We are using uuid as the document ID. During the data write process, we occasionally encounter the following error:
+08:00 2025-10-28 13:22:49 096: task:undefined-EsWriter ; cost:244 ms ; attempt:7 ; sleep:526000 ms ; index:platform.fund.notices.test_a/doc
+08:00 2025-10-28 13:22:49 096: ResponseError: action_request_validation_exception: [action_request_validation_exception] Reason: Validation Failed: 1: id is missing;
+08:00 2025-10-28 13:22:49 096: at Unzip.onBody [as cb] (/app/source_code/node_worker/node_modules/@elastic/elasticsearch/lib/Transport.js:375:23)
+08:00 2025-10-28 13:22:49 096: at Unzip.zlibBufferOnEnd (node:zlib:161:10)
+08:00 2025-10-28 13:22:49 096: at Unzip.emit (node:events:517:28)
+08:00 2025-10-28 13:22:49 096: at endReadableNT (node:internal/streams/readable:1400:12)
+08:00 2025-10-28 13:22:49 096: at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
However, if we rerun the task, the data that previously caused the error can be written successfully.
An example of the uuid field is as follows:
id: 347cc063b9-b9b5a26215e4940669c72be16cfd1e55
After we switched to using shorter Base64 values as the ID, this issue no longer occurs.
Could someone take a look at this when you have a moment? I’d really appreciate it.