We have some documents of elasticsearch . The uniqueness of the document is determined by some fields together, how to ensure uniqueness when java multi-threading determines whether it exists and is inserted. I didn’t know what good method I had before, so I wrote a method: I guess if it exists, if it doesn’t exist, I insert it, and this