# Analyze Wildcard \_all

**URL:** <https://discuss.elastic.co/t/analyze-wildcard-all/107570>\
**Category:** Elasticsearch\
**Created:** [November 14, 2017, 3:37pm UTC](https://discuss.elastic.co/t/analyze-wildcard-all/107570 "2017-11-14T15:37:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [November 14, 2017, 3:37pm UTC](https://discuss.elastic.co/t/analyze-wildcard-all/107570/1 "2017-11-14T15:37:16Z")

</div>

Good morning,

How can I search using a wildcard and \_all the fields?

I have this analyzer:

POST filtreclient\_caste/\_analyze  
{  
"analyzer": "full\_name",  
"text": "001-000009"  
}

{  
"tokens": [  
{  
"token": "001-000009",  
"start\_offset": 0,  
"end\_offset": 10,  
"type": "word",  
"position": 0  
}  
]  
}

And I would like get results if I write this search:

GET filtreclient\_caste/\_search  
{  
"from": 0,  
"size": 10,  
"query": {  
"bool": {  
"should": [  
{  
"wildcard": {  
"\_all": {  
"value": "001-\*",  
"boost": 1  
}  
}  
}  
]  
}  
}  
}

Is possible?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 14, 2017, 4:24pm UTC](https://discuss.elastic.co/t/analyze-wildcard-all/107570/2 "2017-11-14T16:24:46Z")

</div>

The \_all field is analysed, so that will not work. There is however an `all_fields` option available [for the query string query](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-query-string-query.html), which might be suitable. To work like you have outlined, I do however believe all fields you want to search must be available with `keyword` mapping (required for regex match). I am not sure what performance would be like as any regex query its expensive and I have not tested this.

---

<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:** [December 12, 2017, 4:24pm UTC](https://discuss.elastic.co/t/analyze-wildcard-all/107570/3 "2017-12-12T16:24:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
