title: How to avoid same object persistence multiple times elasticsearch
body: <p>I am persisting data through elasticsearch and even though the data is persisted multiple times, it will be stored with auto-generated different string id values. I want multiple entries of the same data to be avoided from being persistence by making the email field as the primary key. How could I achieve this in elasticsearch</p>
  
  <pre><code>{
    "email":"abc@pe.com",
    "name": "abc"
  }
  
  return client.prepareIndex(Constants.INDEX_NAME, Constants.TYPE)
              .setSource(XContentFactory.jsonBuilder()
              .startObject()
                  .field("email", email)
                  .field("name", name)
              .endObject())
              .get();
  </code></pre>