# How to create a query with the wildcard

**URL:** <https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029>\
**Category:** Kibana\
**Created:** [May 20, 2015, 7:51pm UTC](https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029 "2015-05-20T19:51:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavelPolyakov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavelpolyakov/32/44810_2.png) [@PavelPolyakov](https://discuss.elastic.co/u/PavelPolyakov)\
**Post date:** [May 20, 2015, 7:51pm UTC](https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029/1 "2015-05-20T19:51:23Z")

</div>

Assuming I have the next record in my Elasticsearch:  
 ![](https://sea2.discourse-cdn.com/elastic/uploads/default/325/4f79150b9a6035f1.png)

How can I query something like:  
 ![](https://sea2.discourse-cdn.com/elastic/uploads/default/326/a15b24eec4154c54.png)

This doesn't work and it's expected, because if we wrap the query to the quotes, then it would search for the 1 to 1 correspondence.

When I want just to place a wildcard, instead of the url path.

If I query this:  
 ![](https://sea2.discourse-cdn.com/elastic/uploads/default/327/c49f4719e90c5b44.png)

The results would be too broad, because it would break the query by words.

Any suggestion?

---

<div class="post-metadata">

**Author:** ![ankmathur14](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@ankmathur14](https://discuss.elastic.co/u/ankmathur14)\
**Post date:** [September 15, 2015, 9:04am UTC](https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029/2 "2015-09-15T09:04:19Z")

</div>

did you solve this ?  
I am having the same issue.

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [September 26, 2015, 1:33pm UTC](https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029/3 "2015-09-26T13:33:30Z")

</div>

Wildcarded search in Lucene can be tricky depending on your settings and field mappings.

For your use case of looking for one term in some proximity of another, perhaps you can try a [proximity search](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_proximity_searches)?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3d8cbcc0526bdcebb2b00c1af169398770f8387c.png)

---

<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:12pm UTC](https://discuss.elastic.co/t/how-to-create-a-query-with-the-wildcard/1029/4 "2017-07-06T14:12:22Z")

</div>


