# Open-ended multiple word query using wildcards

**URL:** https://discuss.elastic.co/t/open-ended-multiple-word-query-using-wildcards/67718
**Category:** Elasticsearch
**Created:** [December 1, 2016, 6:46am UTC](https://discuss.elastic.co/t/open-ended-multiple-word-query-using-wildcards/67718 "2016-12-01T06:46:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tdicken73](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tdicken73](https://discuss.elastic.co/u/tdicken73)
#### Post date: [December 1, 2016, 6:46am UTC](https://discuss.elastic.co/t/open-ended-multiple-word-query-using-wildcards/67718/1 "2016-12-01T06:46:26Z")

</div>

Hi all,

I'm attempting to write a query that would match against multiple tokens in a query string but with the capability of wildcards on either end of the string. The way I've tried is using wildcardQuery, regExpQuery, and queryStringQuery. This seems straightforward with one token, but I have not had luck with multiple tokens. I'm looking for "_string_" functionality.

For example, searching for  
{"phraseCount":"Three Four Five"}  
could return "Two Three Four Five" and "Three Four Five Six", but not "Three Two Four Five" because the words are not in order ("Three Four Five" has to be in the exact order) or "Two Three Four" because Five is not in the string. I know elasticsearch is capable of more powerful features, but I'm wondering if this is also possible. Thanks in advance

---

<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 29, 2016, 6:46am UTC](https://discuss.elastic.co/t/open-ended-multiple-word-query-using-wildcards/67718/2 "2016-12-29T06:46:31Z")

</div>

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