title: Using regular expressions in elasticsearch term queries
body: <p>I want find all items filtered by ID match some regular expression like</p>
  
  <pre><code>*TEST123*   //pattern for regexp
  </code></pre>
  
  <p>So expected result are items</p>
  
  <p>ATEST123001</p>
  
  <p>ATEST123002</p>
  
  <p>ATEST123003</p>
  
  <p>TTTTEST123001</p>
  
  <p>...</p>
  
  <p>I can create some script which scan full storage and save IDs in log-file which can check later. But I want to find some better solution</p>
  
  <p><strong>Updated</strong>
  I tried </p>
  
  <pre><code>"query" : { "match_all" : { }, "filtered" : { "filter" : { "regexp": { "id":".test123." } } } }, }
  </code></pre>
  
  <p>I receive </p>
  
  <p>//nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"filtered\"]</p>
  
  <p>When I tried  </p>
  
  <pre><code>{
    "regexp": {
      "id": "test123"
    }
  </code></pre>
  
  <p>}</p>
  
  <p>//Parse Failure [No parser for element [regexp]]]</p>
  
  <p>ES 1.7.4 and Lucene 4.10.4 </p>