title: How to rename array values in elastic search
body: <p>I have an array in elastic search document. I want to rename all occurrences of a particular value. It has the following mapping</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;products&quot; : {
      &quot;mappings&quot; : {
        &quot;properties&quot; : {
          &quot;inStock&quot; : {
            &quot;type&quot; : &quot;long&quot;
          },
          &quot;name&quot; : {
            &quot;type&quot; : &quot;keyword&quot;
          },
          &quot;price&quot; : {
            &quot;type&quot; : &quot;double&quot;
          },
          &quot;tags&quot; : {
            &quot;type&quot; : &quot;keyword&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;_index&quot; : &quot;products&quot;,
    &quot;_type&quot; : &quot;_doc&quot;,
    &quot;_id&quot; : &quot;100&quot;,
    &quot;_version&quot; : 6,
    &quot;_seq_no&quot; : 5,
    &quot;_primary_term&quot; : 1,
    &quot;found&quot; : true,
    &quot;_source&quot; : {
      &quot;name&quot; : &quot;Product A&quot;,
      &quot;price&quot; : 50,
      &quot;inStock&quot; : 5,
      &quot;tags&quot; : [
        &quot;tagA&quot;,
        &quot;tagB&quot;,
        &quot;tagC&quot;,
        &quot;tagD&quot;,
        &quot;tagB&quot;
      ]
    }
  }
  </code></pre>
  <p>I am looking for a query to rename <code>tagB</code> to something else, for eg: <code>tagF</code> in all documents which has this matching tag.</p>