使用_reindex API从搜索结果创建索引
我正在将我的搜索请求结果存储在新索引中。 这是我的代码:
POST /_reindex
{
"source": {
"index": "my_index_name",
"query": {
"bool": {
"must": [
{
"match": {
"host.hostname": "value_1"
}
},
{
"match": {
"message": "value_a"
}
}
]
}
},
"size":3
},
"dest": {
"index": "new_test"
}
}
此请求仅限于3个。但是,尺寸限制未考虑。因此,此消息的后请求结果是502错误:
{"ok":false,"message":"backend closed connection"}
我的问题是如何将上述请求结果存储在Elasticsearch的新索引中? 预先感谢您的帮助。
I'am tring to store the results of my search request in new index.
This is my code:
POST /_reindex
{
"source": {
"index": "my_index_name",
"query": {
"bool": {
"must": [
{
"match": {
"host.hostname": "value_1"
}
},
{
"match": {
"message": "value_a"
}
}
]
}
},
"size":3
},
"dest": {
"index": "new_test"
}
}
This request is limited to a size of 3. However the size limit is not taken into account. Hence the Post request result is 502 error with this message:
{"ok":false,"message":"backend closed connection"}
My question is how can i store the result of the request above in a new index in ELasticsearch?
Thank you in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将
max_docs
参数设置为请求。size
参数是用于每批索引的文档数量。You need to set
max_docs
param to your request.size
param is for number of documents to index per batch.您需要指定顶级
max_docs
参数而不是source.size
:You need to specify the top-level
max_docs
parameter instead ofsource.size
: