From below sample elasticsearch data I want to apply wildcard say *.000ANT.* on _id so as to fetch all docs whose _id contains 0
*.000ANT.*
_id
0
This is just an extension on Andrei Stefan's answer
{ "query": { "script": { "script": "doc['_id'][0].indexOf('000ANT') > -1" } } }
Note: I do not know the performance impact of such a query, most probably this is a bad idea. Use with caution and avoid if possible.