# Is there a way to make the query string fuzzy by default?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-make-the-query-string-fuzzy-by-default/338150>\
**Category:** Elasticsearch\
**Created:** [July 11, 2023, 7:13pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-make-the-query-string-fuzzy-by-default/338150 "2023-07-11T19:13:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnrodey](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@johnrodey](https://discuss.elastic.co/u/johnrodey)\
**Post date:** [July 11, 2023, 7:13pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-make-the-query-string-fuzzy-by-default/338150/1 "2023-07-11T19:13:33Z")

</div>

I submit a query string via Java Rest API (QueryStringQueryBuilder). Right now I pass in whatever the user enters and use that as my query string however I would like to automatically apply fuzzy searching, when it makes sense (non-literal, non-wildcarded searches). So that way when users search for "Exampel" it will apply fuzzy searching without them needing to use the '~' character to request a fuzzy search. Is there a way to do this today with the API or would I need to intercept the search string and apply it internally?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2023, 9:50am UTC](https://discuss.elastic.co/t/is-there-a-way-to-make-the-query-string-fuzzy-by-default/338150/2 "2023-07-17T09:50:37Z")

</div>

There is a `fuzziness` parameter on [Query string query | Elasticsearch Guide [8.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html).

You should probably use that. I'd recommending setting it to "AUTO".

---

<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:** [August 14, 2023, 9:50am UTC](https://discuss.elastic.co/t/is-there-a-way-to-make-the-query-string-fuzzy-by-default/338150/3 "2023-08-14T09:50:42Z")

</div>

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