Latest version of documents only in Kibana

I have a document with _id "123456", and when I do a GET in Elasticsearch for that ID in my index I can see that it is _version: 2 which makes sense because I updated it.

However in my Kibana visualizations it seems like it is picking up both versions of the same document when showing the results.

How do I exclude versioned documents from re-appearing in the visualization? For example, this record is showing up twice in my bar graph.

EDIT: I should mention I've tried both of these additions to the savedSearchJson and neither of them appear to do anything/work

"aggs": {
    "latest": {
      "terms": {
        "field": "_id"
      }
    }
  }

and

"aggs": {
    "latest": {
      "max": {
        "field": "version"
      }
    }
  }

Hi @adossi,

This seems unlikely. The version field changing should not cause repeat documents to appear.

How are you verifying the same document is reported twice? Can you perform a search query against your indices to check if there are multiple with the same value, which might cause what you are seeing?

They're definitely the same document - I've done a GET and I've done a _search, only one document is returned with that ID.

My workaround was to change all of my visualizations from doing 'Y Axis - Count' to 'Y Axis - Unique Count on field _id'

The fact that workaround works should indicate that indeed duplicates with the same _id are appearing in the dashboard

Bumping this - Chris have you had a chance to read my previous reply?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.