# How can I combine in simple\_query\_string prefix search and phrase search (similar to match\_phrase\_prefix but with other features of simple\_query\_string)

**URL:** https://discuss.elastic.co/t/how-can-i-combine-in-simple-query-string-prefix-search-and-phrase-search-similar-to-match-phrase-prefix-but-with-other-features-of-simple-query-string/360879
**Category:** Elasticsearch
**Created:** [June 5, 2024, 6:24pm UTC](https://discuss.elastic.co/t/how-can-i-combine-in-simple-query-string-prefix-search-and-phrase-search-similar-to-match-phrase-prefix-but-with-other-features-of-simple-query-string/360879 "2024-06-05T18:24:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Leonid\_P](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@Leonid\_P](https://discuss.elastic.co/u/Leonid_P)
#### Post date: [June 5, 2024, 6:24pm UTC](https://discuss.elastic.co/t/how-can-i-combine-in-simple-query-string-prefix-search-and-phrase-search-similar-to-match-phrase-prefix-but-with-other-features-of-simple-query-string/360879/1 "2024-06-05T18:24:41Z")

</div>

I would like to find documents containing search text with the last token (may be) uncompleted like `"quick brown f*"` matching **"quick brown fox"** but not **"quick and brave brown fox"**.

It is similar to `match_phrase_prefix`, but I would like to use other possibilities of `simple_query_string`, for example wildcards with another token, not only the last one `"q* brown f*"`, or combinations with non-phrase search (wolf `"quick brown f*"`) etc.

Both obvious approaches `"query":"\"quick brown f*\""` and `"query":"\"quick brown f\"*"` do not work, several combinations with ~1 that I've tried don't work either.

Possible workarounds would also be appreciated.

---

<div class="post-metadata">

### Author: ![Leonid\_P](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@Leonid\_P](https://discuss.elastic.co/u/Leonid_P)
#### Post date: [June 18, 2024, 8:04am UTC](https://discuss.elastic.co/t/how-can-i-combine-in-simple-query-string-prefix-search-and-phrase-search-similar-to-match-phrase-prefix-but-with-other-features-of-simple-query-string/360879/2 "2024-06-18T08:04:31Z")

</div>

Any ideas?
