# ES reqexp query not working

**URL:** <https://discuss.elastic.co/t/es-reqexp-query-not-working/54656>\
**Category:** Elasticsearch\
**Created:** [July 4, 2016, 1:47pm UTC](https://discuss.elastic.co/t/es-reqexp-query-not-working/54656 "2016-07-04T13:47:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)\
**Post date:** [July 4, 2016, 1:47pm UTC](https://discuss.elastic.co/t/es-reqexp-query-not-working/54656/1 "2016-07-04T13:47:05Z")

</div>

Hi all,

We are using the query filtered term to search the document in item index,

GET /es\_item/item/\_search  
{  
"query": {  
"filtered": {  
"filter": {  
"term": {  
"\_id": "16404262\_5431"  
}  
}  
}  
}  
}

But the same query with regexp inside the term filter are not working as expected and getting the below error,  
Parse Failure [Failed to parse source [{  
"query": {  
"filtered": {  
"filter": {  
"term": {  
"regexp": {  
"_id": "16404262_\*"  
}  
}  
}  
}  
}  
}  
]]]; nested: QueryParsingException[[ogrds\_item] [term] filter does not support [\_id]]; }]",

GET /es\_item/item/\_search  
{  
"query": {  
"filtered": {  
"filter": {  
"term": {  
"regexp": {  
"_id": "16404262_\*"  
} } } }

Can any one help us to achieve this?

Thanks,  
Ganeshbabu

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 5, 2016, 6:55am UTC](https://discuss.elastic.co/t/es-reqexp-query-not-working/54656/2 "2016-07-05T06:55:05Z")

</div>

Hey,

confused here. Your query uses `id`, but the error message shows `_id`. are you sure you didnt mix up those two fields?

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:38pm UTC](https://discuss.elastic.co/t/es-reqexp-query-not-working/54656/3 "2017-07-05T22:38:21Z")

</div>


