title: How to perform full text search on number fields in ElasticSearch?
body: <h2>Question:</h2>
  
  <p>Without converting a number field to a string, how can I perform a full text search on it?</p>
  
  <p>I'm trying mimic the behavior of <code>_all</code> to dynamically convert a number field to a string when performing a query.</p>
  
  <h1>Example.</h1>
  
  <h2>Setup:</h2>
  
  <pre><code>curl -XPUT http://localhost:9200/test/items/1 -d '{accountId : 12341234, name:"Bob"}'
  curl -XPUT http://localhost:9200/test/items/2 -d '{accountId : 980987, name:"Marry"}'
  curl -XPUT http://localhost:9200/test/items/3 -d '{accountId : 234234, name:"Daniel"}'
  </code></pre>
  
  <h2>Objective:</h2>
  
  <p>Find an <code>accountId</code> with the number 4.</p>
  
  <h2>What I've done.</h2>
  
  <p>I tried these two queries but received 0 hits.</p>
  
  <p>Queries:</p>
  
  <pre><code>curl -XPOST "http://localhost:9200/test/items/_search" -d '{
    "query": {
      "term": {
        "accountId": "4"
      }
    }
  }'
  
  curl -XPOST "http://localhost:9200/test/items/_search" -d '{
    "query": {
      "query_string": {
        "query": "4"
      }
    }
  }'
  </code></pre>
  
  <h2>Output:</h2>
  
  <pre><code>{
      "took": 0,
      "timed_out": false,
      "_shards": {
          "total": 5,
          "successful": 5,
          "failed": 0
      },
      "hits": {
          "total": 0,
          "max_score": null,
          "hits": []
      }
  }
  </code></pre>