Yeah, but as a I said, this is not the correct way to test indexing speed. When indexing multiple documents you should use bulk to increase the indexing speed, if you do not use bulk you will have one API request for every document and this can be slow depending on the case/size of document.
If you want to avoid duplicate documents you need to use a custom _id value.
I have a realtime service and per second I receive more than 2000 message
So I want to check if not exists, insert this record
I can't use bulk, because maybe in this message have duplicated data
My structure is:
get new message
check if exists
if exists => update it
then => insert it