# Match query with Wildcards

**URL:** <https://discuss.elastic.co/t/match-query-with-wildcards/2660>\
**Category:** Elasticsearch\
**Created:** [June 15, 2015, 5:53am UTC](https://discuss.elastic.co/t/match-query-with-wildcards/2660 "2015-06-15T05:53:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ishakya](https://avatars.discourse-cdn.com/v4/letter/i/7bcc69/32.png) [@Ishakya](https://discuss.elastic.co/u/Ishakya)\
**Post date:** [June 15, 2015, 5:53am UTC](https://discuss.elastic.co/t/match-query-with-wildcards/2660/1 "2015-06-15T05:53:49Z")

</div>

Hi All,  
I am writing a search query which involves wildcards now.This works fine now. But my new requirement says to apply a must or match query along with the wildcard.

```
$match[] = array("wildcard" => array("full_name" => strtolower((Input::get('Name'))."*")); 
$match[] = array("wildcard" => array("address" => strtolower((Input::get('Address'))."*")); 
$match[] = array("wildcard" => array("email" => strtolower((Input::get('Email'))."*")); 

//////this is the match or must should apply
 $match[] = array("should" => array("Gender" => strtolower(Input::get('Gender'))));
                                            
$searchParams['body']['query']['bool']['should'] = array($match); 

```

but if i apply like this, query returns an error.according to the error i feel that i cannot apply match and wildcard together.

is there any way of doing that?

Any help would be great.or any suggestions are welcome

---

<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, 12:07am UTC](https://discuss.elastic.co/t/match-query-with-wildcards/2660/2 "2017-07-06T00:07:32Z")

</div>


