title: How to update an entry on Elastic Search using Java client
body: <p>I am trying to make an update on my es model information using an elastic search client </p>
  
  <pre><code>org.elasticsearch.client.Client
  </code></pre>
  
  <p><a href="https://www.programcreek.com/java-api-examples/?api=org.elasticsearch.client.Client" rel="nofollow noreferrer">https://www.programcreek.com/java-api-examples/?api=org.elasticsearch.client.Client</a></p>
  
  <p>It is really hard for me to find the correct way to do it since I dont know the index and the matcher, Im sorry, I am very beginer at this subject.</p>
  
  <pre><code>  {
      "_index": "my_index_20",
      "_type": "student",
      "_id": "a80ae58",
      "_source": {
        "model": {
          "id": "a80ae58748e",
          "name": "John Doe"
          ....
  </code></pre>
  
  <p>My code so far </p>
  
  <pre><code> response = esClient.prepareUpdate("student", "name", "John Doe")
                      .setDoc(jsonBuilder()               
                      .startObject()
                      .field("name", "Joe Doe")
                      .endObject())
                      .get();
  </code></pre>
  
  <p>Am I using the right index? or what could I change here?</p>
  
  <p>I am not getting any error but a "document missing" result... means I might not be using the right indexes.</p>
  
  <p>Ideas?</p>
  
  <p>Updated according feedback and more info...</p>
  
  <p>I moved it to </p>
  
  <pre><code>response = esClient.prepareUpdate("my_index_20", "student", "a80ae58")
                      .setDoc(jsonBuilder()               
                      .startObject()
                      .field("name", "Joe Doe")
                      .endObject())
                      .get();
  </code></pre>
  
  <p>This works but since I dont know the index ID I cannot perform this, is there any way to do it by a query builder or other functionality? </p>