title: Trying to understand how to update a mapping without requiring a complete rebuild of the index?
body: <p>From this page: <a href="https://www.elastic.co/blog/changing-mapping-with-zero-downtime" rel="nofollow noreferrer">https://www.elastic.co/blog/changing-mapping-with-zero-downtime</a> it states:</p>
  <blockquote>
  <p>I don't care about old data
  What if you want to change the datatype for a single field, and you don't care about the fact that the old data is not searchable? In this case, you have a few options:</p>
  <p>Delete the mapping
  If you delete the mapping for a specific type, then you can use the put_mapping API. to create a new mapping for that type in the existing index.</p>
  </blockquote>
  <p>...</p>
  <p>My situation is, I have a column that was a string, and I want to change it to a long...  According to that document, it sounds like I should just be able to do:</p>
  <pre><code>curl -X DELETE localhost:9200/my_index/_mapping/property_to_change
  </code></pre>
  <p>and then do</p>
  <pre><code>curl -XPUT 'http://localhost:9200/my_index/_mapping/property_to_change' -d '
  {
      &quot;my_index&quot; : {
          &quot;properties&quot; : {
              &quot;property_to_change&quot; : {&quot;type&quot; : &quot;long&quot;, &quot;store&quot; : true }
          }
      }
  }
  '
  </code></pre>
  <p>Am I misunderstanding this?  Do I really have to go through the trouble of creating an alias?   is there not a simple way I can just change this one property's type?</p>
  <p>I find the documentation regarding this topic high confusing and contradictory.. for example this page <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html</a>
  says:</p>
  <blockquote>
  <p>You can specify the mapping for a type when you first create an index. Alternatively, you can add the mapping for a new type (or update the mapping for an existing type) later, using the /_mapping endpoint.</p>
  </blockquote>
  <p>Which sounds like -- ok cool. that's exactly what I want to do.</p>
  <p>But then the next paragraph says:</p>
  <blockquote>
  <p>Although you can add to an existing mapping, you can’t change it. If a field already exists in the mapping, the data from that field probably has already been indexed. If you were to change the field mapping, the already indexed data would be wrong and would not be properly searchable.</p>
  </blockquote>
  <p>I thought it just said you can update the mapping?  now it says you can't change it?  Sooo confused.</p>
  <p>Can anyone please shed some light on this?</p>