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.
You need to specify the top-level
max_docs
parameter instead ofsource.size
: