Hi Team elastic,
We have a use case, where we created a continuous pivot transform on a source index to get count of status of transactions. If status of any of the transaction changes, the same document appears in destination index with a different status and count 1. So now we have two documents, each with status count as 1. However on further changes on the same document gives correct count. So we have two questions -
- We wanted to know about the delete behaviour of transform API. Is it able to identify the modified documents and aggregate on that to show correct results?
- Is there a way that we can pre define the value of status with count as zero and then transform can calculate the count correctly?
Here's the transform
PUT _transform/tradebystatusbucket
{
"source": {
"index": [
"latest-transactions"
]
},
"pivot": {
"group_by": {
"submissionAccountName": {
"terms": {
"field": "submissionAccountName.keyword"
}
},
"executingEntityIdCode": {
"terms": {
"field": "executingEntityIdCode.keyword"
}
},
"regulator": {
"terms": {
"field": "regulator.keyword"
}
},
"assetClass": {
"terms": {
"field": "assetClass.keyword"
}
},
"status": {
"terms": {
"field": "status.keyword"
}
}
},
"aggs": {
"keywords": {
"value_count": {
"field": "status.keyword"
}
}
}
},
"frequency": "10s",
"dest": {
"index": "tradebystatusarmbucket"
},
"sync": {
"time": {
"field": "ingest_time",
"delay": "1s"
}
},
"settings": {
"max_page_search_size": 500
}
}