I am looking for more efficient and performance way to implement below use case:
- Every input JSON contains event_timestamp and document_id field. document_id is '_id' for the index.
- If a document with document_id already exists in index and event_timestamp of new input json is latest than existing document's event_timestamp, perform update operation
- If a document with document_id already exists in index, but, event_timestamp of new input json is older than existing document's event_timestamp, no operations
- If document with document_id not exists in index, perform insert operation
Currently, I am performing 2 round trip calls to from Elasticsearch. Is there any better way to do similar to hbase timestamp column which stores latest timestamp event ?
Thanks in Advance.