# Wildcard in a match\_phrase query

**URL:** <https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775>\
**Category:** Elasticsearch\
**Created:** [June 26, 2020, 3:38am UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775 "2020-06-26T03:38:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manjunath\_Venkatram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manjunath_venkatram/32/60397_2.png) [@Manjunath\_Venkatram](https://discuss.elastic.co/u/Manjunath_Venkatram)\
**Post date:** [June 26, 2020, 3:38am UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775/1 "2020-06-26T03:38:41Z")

</div>

Hi

I am trying to do a wildcard query on a field as below,  
{"clientPort":{"query":"\*"}}, my intention is for the query to bring any/all values associated with clientPort, is this possible ? currently i dont get anything with \*

Full query below

"{"search\_type":"query\_then\_fetch","ignore\_unavailable":true,"index":"granular\_smtp"} {"size":0,"query":{"bool":{"filter":[{"range":{"ts":{"gte":"1593138953932","lte":"1593142553932","format":"epoch\_millis"}}},{"query\_string":{"analyze\_wildcard":true,"query":"_"}}],"must":[{"match\_phrase":{"clientIp":{"query":"75.211.55.138"}}},{"match\_phrase":{"serverPort":{"query":"25"}}},{"match\_phrase":{"clientPort":{"query":"_"}}}]}},"aggs":{"2":{"date\_histogram":{"interval":"1d","field":"ts","min\_doc\_count":0,"extended\_bounds":{"min":"1593138953932","max":"1593142553932"},"format":"epoch\_millis"},"aggs":{"1":{"avg":{"field":"responseTime"}}}}}} "

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 26, 2020, 5:56am UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775/2 "2020-06-26T05:56:03Z")

</div>

Welcome!

Could you indent your code so it's easier to read it?

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

Please update your post.

---

<div class="post-metadata">

**Author:** ![Manjunath\_Venkatram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manjunath_venkatram/32/60397_2.png) [@Manjunath\_Venkatram](https://discuss.elastic.co/u/Manjunath_Venkatram)\
**Post date:** [June 27, 2020, 9:51am UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775/3 "2020-06-27T09:51:14Z")

</div>

sorry i am new here, i dont seem to find a way to edit the original post to make changes, Could you please suggest how to edit the post

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 27, 2020, 12:25pm UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775/4 "2020-06-27T12:25:49Z")

</div>

I think you should see this button at the bottom.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d14c8cbd383d47c300218e9716ab2657200fce9d.jpeg)

---

<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 25, 2020, 12:25pm UTC](https://discuss.elastic.co/t/wildcard-in-a-match-phrase-query/238775/5 "2020-07-25T12:25:50Z")

</div>

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