【发布时间】:2017-01-07 07:47:45
【问题描述】:
我对 Elasticsearch 还很陌生: 我有一个 Elasticsearch 映射,旨在容纳来自高度规范化的 SQL Server 数据库的数据。 每次进行结构更改(映射更改)时,我都会加载数百万条记录。这有时会非常庞大和缓慢,需要数天才能完成。 我正在尝试找到一种方法来部分更新嵌套数组和嵌套对象字段,而无需索引整个索引数据。
这就是我的映射的样子:
{
"Product": {
"dynamic": "strict",
"properties": {
"ProductID": {
"type": "integer"
},
"ProductCategory": {
"index": "not_analyzed",
"type": "string"
},
"TotalNumberOfProduct": {
"type": "float"
},
"MetalProduct": {
"type": "nested",
"properties": {
"MetalProductCategory": {
"index": "not_analyzed",
"type": "string"
},
"MetalProductDescription": {
"index": "not_analyzed",
"type": "string"
},
"MetalProductID": {
"type": "integer"
}
}
}
}
}
}
我可以在一个 Product 文档下有多个 MetalProducts 嵌套数组文档。 例如。在 ProductID 001 下,我可以拥有 MetalProductID=222 MetalProductID=333。如何更新 ProductID=001 下的一个特定嵌套文档 (MetalProductID=222)?感谢您的帮助。
【问题讨论】:
-
这个答案可能会有所帮助:stackoverflow.com/questions/38741658/…
标签: arrays api elasticsearch nested updates