title: elasticsearch upsert without document id
body: <p>I query my index to find a document. If I find a document I know the _id value to update else I don't have _id value.</p>
  
  <p>Using the upsert below, I can update when I have _id. If I dont have _id how can I have elasticsearch to provide one and insert a new document?</p>
  
  <p>Purpose: I dont want to have 2 functions, one to create a new doc and another to update it...</p>
  
  <pre><code>curl -XPOST 'localhost:9200/test/type1/{value_of_id}/_update' -d '{
    "doc" : {
        "name" : "new_name"
    },
    "doc_as_upsert" : true
  </code></pre>
  
  <p>}</p>