# Need example for match query with fuzziness

**URL:** <https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014>\
**Category:** Elasticsearch\
**Created:** [November 19, 2015, 5:46am UTC](https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014 "2015-11-19T05:46:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlk](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@nlk](https://discuss.elastic.co/u/nlk)\
**Post date:** [November 19, 2015, 5:46am UTC](https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014/1 "2015-11-19T05:46:27Z")

</div>

Hi!  
A have 2 records in type "authors", and use elasticsearch\_dsl to perform queries to es.  
Now i want to find record in type authors with first\_name like "danil".  
In index i have this recordm but first\_name in it == Donil.

I try to query record from ES using this DSL

```
{
    "query": {
        "match": {
            "first_name": "Danil",
            "fuzziness": 2
        }
    }
}

```

but got exception in es:

```
{
  "error": {
    "root_cause": [
      {
        "type": "query_parsing_exception",
        "reason": "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?",
        "index": "delphi",
        "line": 4,
        "col": 34
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "delphi",
        "node": "QEfmrg55TNyUkiCs7ja8hg",
        "reason": {
          "type": "query_parsing_exception",
          "reason": "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?",
          "index": "delphi",
          "line": 4,
          "col": 34
        }
      }
    ]
  },
  "status": 400
}

```

What i'm doing wrong?

---

<div class="post-metadata">

**Author:** ![nlk](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@nlk](https://discuss.elastic.co/u/nlk)\
**Post date:** [November 19, 2015, 6:57am UTC](https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014/2 "2015-11-19T06:57:21Z")

</div>

Got it!  
The solution is:

```
   {
        "query": {
            "bool": {
                "must": [ 
                    {
                        "match": {
                            "first_name": {
                                "query": "danil",
                                "fuzziness": 2
                            }
                        }
                    }
                ]
            }
        }
    }
```

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [November 19, 2015, 11:09am UTC](https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014/3 "2015-11-19T11:09:35Z")

</div>

> [@nlk](#):
>
> "reason": "[match] query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?",

This pretty much states what you are supposed to do instead. The following example in the docs might help you:

> **[Fuzzy match Query | Elasticsearch: The Definitive Guide \[2.x\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/fuzzy-match-query.html#fuzzy-match-query)**

Hope this helps,  
Isabel

---

<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:** [July 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/need-example-for-match-query-with-fuzziness/35014/4 "2017-07-05T23:37:18Z")

</div>


