【发布时间】:2016-05-30 12:39:18
【问题描述】:
我想索引 10 亿条记录。每条记录有 2 个属性(属性 1 和属性 2)。 在属性 1 中具有相同值的每条记录都必须合并。例如,我有两条记录
attribute1 attribute2
1 4
1 6
我的弹性文档必须是
{
"attribute1": "1"
"attribute2": "4,6"
}
由于数据量巨大,我必须读取大量(大约1000条记录)并根据上述规则将它们合并(在内存中),然后在ElasticSearch中搜索它们并将它们与搜索结果合并,然后索引/重新索引他们。 总之,我必须分别按批量搜索和索引。 我实现了这条规则,但在某些情况下,Elastic 不会返回所有结果,并且某些文档已被重复索引。 在每个索引之后,我都会刷新 ElasticSearch,以便为下一次搜索做好准备。但在某些情况下它不起作用。 我的索引设置如下:
{
"test_index": {
"settings": {
"index": {
"refresh_interval": "-1",
"translog": {
"flush_threshold_size": "1g"
},
"max_result_window": "1000000",
"creation_date": "1464577964635",
"store": {
"throttle": {
"type": "merge"
}
}
},
"number_of_replicas": "0",
"uuid": "TZOse2tLRqGk-vHRMGc2GQ",
"version": {
"created": "2030199"
},
"warmer": {
"enabled": "false"
},
"indices": {
"memory": {
"index_buffer_size": "40%"
}
},
"number_of_shards": "5",
"merge": {
"policy": {
"max_merge_size": "2g"
}
}
}
}
我该如何解决这个问题?
有没有其他设置可以处理这种情况?
【问题讨论】:
标签: search elasticsearch indexing