How to stop duplicate entries using elasticsearch plugin

If you look in the documentation the example given under the docinfo section, this seems to show how to assign document id from the metadata fields, which is the default location for this information.