# Fuzzy Search on some selected fields

**URL:** <https://discuss.elastic.co/t/fuzzy-search-on-some-selected-fields/1937>\
**Category:** Elasticsearch\
**Created:** [June 4, 2015, 1:46pm UTC](https://discuss.elastic.co/t/fuzzy-search-on-some-selected-fields/1937 "2015-06-04T13:46:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hichem\_MAALMI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hichem_maalmi/32/515_2.png) [@Hichem\_MAALMI](https://discuss.elastic.co/u/Hichem_MAALMI)\
**Post date:** [June 4, 2015, 1:46pm UTC](https://discuss.elastic.co/t/fuzzy-search-on-some-selected-fields/1937/1 "2015-06-04T13:46:24Z")

</div>

Hi,

We are trying to make a search query that looks for a text in multiple fields with eventually different scores per field and the possibility to make a fuzzy search on some of them.

a sample of a generated query

```
 {
      "query": {
          "filtered": {
              "query": {
                  "dis_max": {
                      "queries": [{
                          "bool": {
                              "should": [{
                                  "match": {
                                      "subject": {
                                          "query": "test",
                                          "type": "boolean",
                                          "boost": 1,
                                          "fuzziness": "AUTO"
                                      }
                                  }
                              }, {
                                  "match": {
                                      "user.full_name.name": {
                                          "query": "test",
                                          "type": "boolean",
                                          "boost": 1,
                                          "fuzziness": 0
                                      }
                                  }
                              }, {
                                  "match": {
                                      "owner.full_name.name": {
                                          "query": "test",
                                          "type": "boolean",
                                          "boost": 1,
                                          "fuzziness": 0
                                      }
                                  }
                              }],
                              "minimum_should_match": 1
                          }
                      }]
                  }
              }
          }
      },
      "highlight": {
          "fields": {
              "subject": {},
              "user.full_name.name": {},
              "owner.full_name.name": {},
          }
      },
      "sort": ["_score"],
      "size": 10,
      "from": 0
  }

```

The problem with fuzziness is that once we set it for a subquery( subject in this example ) it gets applied to all other queries (user.full\_name and owner.full\_name) which is not the wanted behavior.

I wonder if this is the right way to activate fuzziness on some selected fields without affecting the others.

Any help would be appreciated.  
Thank you

---

<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 6, 2017, 12:09am UTC](https://discuss.elastic.co/t/fuzzy-search-on-some-selected-fields/1937/2 "2017-07-06T00:09:37Z")

</div>


