# Wildcard queries don't work with \_id field

**URL:** <https://discuss.elastic.co/t/wildcard-queries-dont-work-with--id-field/11873>\
**Category:** Elasticsearch\
**Created:** [May 8, 2013, 6:41am UTC](https://discuss.elastic.co/t/wildcard-queries-dont-work-with--id-field/11873 "2013-05-08T06:41:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasiliy](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@Vasiliy](https://discuss.elastic.co/u/Vasiliy)\
**Post date:** [May 8, 2013, 6:41am UTC](https://discuss.elastic.co/t/wildcard-queries-dont-work-with--id-field/11873/1 "2013-05-08T06:41:57Z")

</div>

Hello, all!

I'm trying to issue a following query on \_id field

{  
"query": {  
"bool": {  
"must": [  
{  
"wildcard": {  
"myindex.\_id": "\*"  
}  
}  
],  
"must\_not": [],  
"should": []  
}  
},  
"from": 0,  
"size": 50,  
"sort": [],  
"facets": {}  
}

and it returns no result set.

Note, that I've specified the mapping for \_id field as follows:  
{  
"myindex": {  
"properties": {  
"\_id": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
}  
}

But if I substitute wildcard query with term, prefix or query\_string - than  
query will return result set.

Could someone explain to me this behaviour of a wildcard query?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:37am UTC](https://discuss.elastic.co/t/wildcard-queries-dont-work-with--id-field/11873/2 "2017-07-06T02:37:43Z")

</div>


