# Disable Fuzziness in Query

**URL:** <https://discuss.elastic.co/t/disable-fuzziness-in-query/280073>\
**Category:** Elasticsearch\
**Created:** [July 30, 2021, 11:24am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073 "2021-07-30T11:24:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [July 30, 2021, 11:24am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073/1 "2021-07-30T11:24:21Z")

</div>

I am fetching results with the following query where search is being done on Strings (Recipe name):

```auto
let body2 = {
        size: 200,
        from: 0,
        sort : [
            { "@timestamp" : {"order": "desc", "format": "strict_date_optional_time_nanos"}}
        ],
        //fuzziness: "1",// "AUTO: 0,2",
        query: {
            // Recipe: req.query['q'],
            // FLAG: 'END'
            bool: {
                must: [
                    {
                        match: {
                            Line: req.query['q']
                        }
                    },
                    {
                        match: {
                            FLAG: "END"
                        }
                    },
                    {
                        match: {
                            Recipe: req.query['recipe']
                        }
                    },
                    {
                        range: {
                            "@timestamp": {
                                gte: req.query['sDate'],
                                lte: req.query['eDate']
                            }
                        }
                    }
                ]
            }
        }

```

The response I am getting contains those results as well which are not a complete match with the searched recipe (contains those results which has some matching substring). Is there anyway for me to remove fuzziness and only fetch those results which have a 100% match?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 2, 2021, 7:45am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073/2 "2021-08-02T07:45:09Z")

</div>

Fuzziness is disabled by default, so if you leave it out, this is not the reason for documents matching. However the `match` query uses the `OR` operator by default. Keep that in mind when searching for several terms.

---

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [August 3, 2021, 9:06am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073/3 "2021-08-03T09:06:24Z")

</div>

Thanks @spinscale Is there a way to change this default `OR` to `AND`?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 3, 2021, 9:11am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073/4 "2021-08-03T09:11:07Z")

</div>

no, this needs to be done as part of the query.

---

<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 31, 2021, 9:11am UTC](https://discuss.elastic.co/t/disable-fuzziness-in-query/280073/5 "2021-08-31T09:11:40Z")

</div>

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