Reputation: 39
POST /_reindex?wait_for_completion=false //reindexing
{
"source": {
"index": "as.event-154",
"aggs": {
"group": {
"terms": {
"field": "ancestor_id",
"size": 1 // note this
},
"aggs": {
"group_docs": {
"top_hits": {
"size": 10,
"_source": false,
"sort": [
{
"event_id.keyword": {
"order": "desc"
}
}
]
}
}
}
},
"bucketcount": {
"stats_bucket": {
"buckets_path": "group._count"
}
}
}
},
"dest": {
"index": "as.event-154new1"
}}
This is my elastic query to create the new index based on the aggregation filter. It creates a new index with all data. but I need only the specific conditions data. Please help to fix these issues
Upvotes: 0
Views: 49
Reputation: 3660
You can add query
parameter in source
.
POST /_reindex
{
"source": {
"index": "test",
"query": {...}, <---
"aggs": {..}
},
"dest": {...}
}
Upvotes: 1