我不知道我的索引是否啟用/禁用了動態欄位。當我使用 get index mapping 命令時,它只回應以下資訊:
GET /my_index1/_mapping
{
"my_index1": {
"mappings": {
"properties": {
"goodsName": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"auditTime": {
"type": "long"
},
"createUserId": {
"type": "long"
}
}
}
}
}
uj5u.com熱心網友回復:
如果您沒有明確設定dynamictofalse或strict,則true默認為。如果您明確設定,您將在映射中看到:
{
"mappings": {
"dynamic": false,
"properties": {
"name": {
"type": "text"
}
}
}
}
當您索引以下檔案時:
{"name":"products", "clickCount":1, "bookingCount":2, "isPromoted":1}
只有該欄位name會被索引,其余的不會。如果您_mapping再次呼叫端點,它將為您提供上面的確切映射。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/344574.html
