# Query\_string query with fuzzy matching enabled without explicit \`~\` operators

**URL:** https://discuss.elastic.co/t/query-string-query-with-fuzzy-matching-enabled-without-explicit-operators/198101
**Category:** Elasticsearch
**Created:** [September 4, 2019, 7:44pm UTC](https://discuss.elastic.co/t/query-string-query-with-fuzzy-matching-enabled-without-explicit-operators/198101 "2019-09-04T19:44:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rocketraman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rocketraman/32/32342_2.png) [@rocketraman](https://discuss.elastic.co/u/rocketraman)
#### Post date: [September 4, 2019, 7:44pm UTC](https://discuss.elastic.co/t/query-string-query-with-fuzzy-matching-enabled-without-explicit-operators/198101/1 "2019-09-04T19:44:33Z")

</div>

With **query\_string** for queries, a user can use operators like AND and OR. However, if they are searching for the term `bill` and type in `bil` as a search term, they don't find anything (the field uses a standard analyzer).

The **query\_string** query can of course be written as `bil~` but a) this only helps if the user knows about this capability, and b) it assumes this isn't just a spelling mistake.

One option is to use a term suggester to detect the issue and provide the correction, however I was also thinking about applying "fuzziness by default" to all the terms. Are there good reasons _not_ to do this?

Also, as far as I can tell, a fuzziness-by-default approach requires parsing the query, modifying the resulting data structure to include the fuzziness operator on each term, and then reformulating that as an ES search. Are there libraries people are using to parse query strings? I see this SO answer [https://stackoverflow.com/a/52100519/430128](https://stackoverflow.com/a/52100519/430128) which refers to the EBNF grammer used to parse the query string.

---

<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 2, 2019, 7:56pm UTC](https://discuss.elastic.co/t/query-string-query-with-fuzzy-matching-enabled-without-explicit-operators/198101/2 "2019-10-02T19:56:46Z")

</div>

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