Date as _id

Hi i only used elasticsearch for centralised logging before,
we are considering to use elasticsearch to index analytics data for our apps for easier aggregation.

For upsert convenience i was thinking to use the date as id.
Example: {provider}/{analytics-type}

From my understanding if i want to aggregate over multiple specific types i can just do:

I obviously still will have all the information like provider, app-id and co inside the document.

Is there any downside to using the date as _id that i am missing?

is there two or more records with the same date stamp to save in one type?

no, separation is done with index and types, so there will always be only one document for one date(or depending on type date_country)

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