title: Are ElasticSearch query results cached?
body: <p>I'm using ElasticSearch 2.3 and ASP.NET web application. I'm calling ElasticSearch through its REST API using C# <code>HttpClient</code>.</p>
  
  <p>I have a problem when trying to add new values to an array.</p>
  
  <p>Here's essentially the queries that I'm performing:</p>
  
  <p>Step 1: Get note </p>
  
  <pre><code>POST /notes/note/_search
  {
    "query" : {
      "term" : { "_id" : 1 }
    }
  }
  </code></pre>
  
  <p>There's only 1 note and the result shows that the note contains an empty array of attachments</p>
  
  <p>Step2: Update note attachments array</p>
  
  <pre><code>POST: /notes/note/1/_update
  {
     "doc" : { 
        "Attachments" : [ "Test" ]
     }
  }
  </code></pre>
  
  <p>Step3: Get note again</p>
  
  <pre><code>POST: /notes/note/_search
  {
    "query" : {
      "term" : { "_id" : 1 }
    }
  }
  </code></pre>
  
  <p>The result shows that the note <strong>still contains an empty Attachments array</strong>.</p>
  
  <p>However, when I Search/MatchAll from Kibana, I see that the Attachments array has been updated with the new item. However, when running all those steps from ASP.NET, I'm not getting the updated document when immediately searching for it right after the update.</p>
  
  <p>Is this caused by some kind of caching ?</p>
  
  <p>What must I do to get consistent state of the document after an update has been performed ?</p>
  
  <p>Any help appreciated!
  Thanks</p>