# Phrase search with fuzziness

**URL:** <https://discuss.elastic.co/t/phrase-search-with-fuzziness/317725>\
**Category:** Elasticsearch\
**Created:** [October 29, 2022, 12:24pm UTC](https://discuss.elastic.co/t/phrase-search-with-fuzziness/317725 "2022-10-29T12:24:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davood1659](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davood1659/32/47291_2.png) [@Davood1659](https://discuss.elastic.co/u/Davood1659)\
**Post date:** [October 29, 2022, 12:24pm UTC](https://discuss.elastic.co/t/phrase-search-with-fuzziness/317725/1 "2022-10-29T12:24:34Z")

</div>

Hi all,

A while ago, I needed to find documents that a certain term(word) is repeated twice or more in a certain field of those documents. Some queries like `Match` query doesn't work in such situations as they just check whether any word of search text exists in document field or not. Therefore, I had to use `match_phrase` query as it also allows the words of search text to be in any order which was really important to me.

The problem is that I need to include fuzziness in my search query explained above and unfortunately, `match_phrase` query doesn't support fuzziness. According to my Google searches, everyone recommends using `span_near` query rather than `match_phrase` for this purpose and it works for normal cases very well, but when there are duplicate words in search text, it seems `span_near` is not able to match any word in search text individually. Please note that I have to use `span_near` query with `"slop": 50` and `"in_order": false` to achieve the functionality just like what `match_phrase` query provides. If I'm wrong, please let me know.

Does anyone know how I can achieve `Match Phrase` behaviour along with fuzziness without using `span_near` query? Any help would be much 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:** [November 26, 2022, 12:24pm UTC](https://discuss.elastic.co/t/phrase-search-with-fuzziness/317725/2 "2022-11-26T12:24:49Z")

</div>

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