Q:

Using regular expressions in elasticsearch term queries

I want find all items filtered by ID match some regular expression like
*TEST123*   //pattern for regexp

So expected result are items
ATEST123001
ATEST123002
ATEST123003
TTTTEST123001
...
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
Updated
I tried 
"query" : { "match_all" : { }, "filtered" : { "filter" : { "regexp": { "id":".test123." } } } }, }

I receive 
//nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"filtered\"]
When I tried  
{
  "regexp": {
    "id": "test123"
  }

}
//Parse Failure [No parser for element [regexp]]]
ES 1.7.4 and Lucene 4.10.4 

A:

You can try Query String.
{
"query": {
 "query_string": {
    "default_field": "if",
    "query": "*test123*"
   }
  }
}  

