title: How to make elasticsearch document ttl work?
body: <p>I installed <a href="http://www.elasticsearch.org/download/" rel="nofollow noreferrer">debian package</a></p>
  
  <p>I am able to push data using curl:</p>
  
  <pre><code>curl -XPUT 'http://mybox:9200/blog/user/dilbert' -d '{
    "name": "Dilbert Brown"
  }'
  </code></pre>
  
  <p>And fetch it</p>
  
  <pre><code>curl -XGET 'http://mybox:9200/blog/user/dilbert'
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>{
    "_index": "blog",
    "_type": "user",
    "_id": "dilbert",
    "_version": 2,
    "exists": true,
    "_source": {
      "name": "Dilbert Brown"
    }
  }
  </code></pre>
  
  <p>And find it with</p>
  
  <pre><code>curl -XGET 'http://mybox:9200/blog/user/_search?q=name:Dilbert+Brown&amp;pretty=True'
  </code></pre>
  
  <p>I want to push the same record with ttl of 5 seconds and 5 seconds later get 404 http status code when trying to fetch this entry. Also the entry should not be visible in search results.</p>
  
  <p>NOTE: I tried various combinations of search configurations from</p>
  
  <ul>
  <li><a href="http://www.elasticsearch.org/guide/reference/mapping/ttl-field/" rel="nofollow noreferrer">http://www.elasticsearch.org/guide/reference/mapping/ttl-field/</a></li>
  <li><a href="http://www.elasticsearch.org/guide/reference/api/index_/" rel="nofollow noreferrer">http://www.elasticsearch.org/guide/reference/api/index_/</a></li>
  <li><a href="http://elasticsearch-users.115913.n3.nabble.com/TTL-in-elastic-search-is-not-working-td4034844.html" rel="nofollow noreferrer">http://elasticsearch-users.115913.n3.nabble.com/TTL-in-elastic-search-is-not-working-td4034844.html</a></li>
  </ul>
  
  <p>None of them helped me out.</p>
  
  <p>Can somebody mention a simple sequence of steps that would let me achieve the targeted outcome?</p>