GET cross_dms_receive_send_diff/cross_dms_receive_send_diff/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"waybill_code": "VD52794532626"
}
},
{
"range": {
"inspect_time": {
"gt": "1556294400000", // 2019/4/27 0:0:0
"lt": "1556467199000" // 2019/4/28 23:59:59
}
}
}
]
}
},
"aggs": {
"inspect_time": {
"terms": {
"field": "inspect_time"
}
}
}
}
{
"_shards": {
"total": 32,
"failed": 0,
"successful": 32
},
"hits": {
"hits": [
{
"_index": "cross_dms_receive_send_diff",
"_type": "cross_dms_receive_send_diff",
"_source": {
"waybill_code": "VD52794532626",
"inspect_time": 1553966138000 // 1. 2019/3/31 1:15:38
},
"_id": "VD52794532626-1-1-|1086",
"_score": 17.218697
}
],
"total": 1,
"max_score": 17.218697
},
"took": 12,
"timed_out": false,
"aggregations": {
"inspect_time": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key_as_string": "2019-03-30T17:15:38.000Z",// 2.
"doc_count": 1,
"key": 1553966138000
},
{
"key_as_string": "2019-04-27T02:51:50.000Z",//3.
"doc_count": 1,
"key": 1556333510000
}
]
}
}
}
This is the production environment, the test environment cannot be reproduced。
one document after update operation , looks like there are 2 indices .
one for old ,another for new ,but the _source
is old .
"_id": "VD52794532626-1-1-|1086"
"key_as_string": "2019-03-30T17:15:38.000Z"// 2. first index the doc
"key_as_string": "2019-04-27T02:51:50.000Z",//3. update...
Many of the data updated during this time are like this(wrong), and after one day , the subsequent update operations are normal. No operation during this period
General speeking ,the result of the aggregation should be a bucket, not the two here.
How to explain this? How to avoid the next occurrence?
The doc field inspect_time
mapping:
"inspect_time": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
}
Thank you for your help。