# Match\_bool\_prefix query acts different than Prefix query when searching on a single token

**URL:** <https://discuss.elastic.co/t/match-bool-prefix-query-acts-different-than-prefix-query-when-searching-on-a-single-token/285105>\
**Category:** Elasticsearch\
**Created:** [September 24, 2021, 5:45pm UTC](https://discuss.elastic.co/t/match-bool-prefix-query-acts-different-than-prefix-query-when-searching-on-a-single-token/285105 "2021-09-24T17:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_M1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_m1/32/95041_2.png) [@Mike\_M1](https://discuss.elastic.co/u/Mike_M1)\
**Post date:** [September 24, 2021, 5:45pm UTC](https://discuss.elastic.co/t/match-bool-prefix-query-acts-different-than-prefix-query-when-searching-on-a-single-token/285105/1 "2021-09-24T17:45:31Z")

</div>

Having an issue with match\_bool\_prefix behaving weirdly when having an ampersand at the end of a one token query. According to docs, it should build out a term query with a prefix at the end. However, it does that fine except when there's a special character at the end. Please enlighten why its working this way. I just need to understand why its not. I typed this out in stackoverflow so please look at this link and come back here:

> <https://stackoverflow.com/questions/69308426/elasticsearch-match-bool-prefix-query-fails-with-ampersand-at-the-end-of-the-que>

Any help is appreciated.

---

<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:** [October 22, 2021, 5:46pm UTC](https://discuss.elastic.co/t/match-bool-prefix-query-acts-different-than-prefix-query-when-searching-on-a-single-token/285105/2 "2021-10-22T17:46:06Z")

</div>

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