# Boosting sku.exact (not\_analyzed) not returning expected results

**URL:** <https://discuss.elastic.co/t/boosting-sku-exact-not-analyzed-not-returning-expected-results/26817>\
**Category:** Elasticsearch\
**Created:** [August 4, 2015, 4:36pm UTC](https://discuss.elastic.co/t/boosting-sku-exact-not-analyzed-not-returning-expected-results/26817 "2015-08-04T16:36:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zelfapp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zelfapp/32/108888_2.png) [@Zelfapp](https://discuss.elastic.co/u/Zelfapp)\
**Post date:** [August 4, 2015, 4:36pm UTC](https://discuss.elastic.co/t/boosting-sku-exact-not-analyzed-not-returning-expected-results/26817/1 "2015-08-04T16:36:54Z")

</div>

When searching on my sku.exact field, if there is an exact match I want that item to always be listed first. I'm missing something in my query to boost the sku.exact matching.

**Essential Parts of my Mapping:**

```
{
   "mymap.v1": {
      "mappings": {
         "mymap": {
            "_all": {
               "enabled": false
            },
            "properties": {
               "sbb": {
                  "type": "boolean"
               },
               "sku": {
                  "type": "string",
                  "analyzer": "full_name",
                  "fields": {
                     "exact": {
                        "type": "string",
                        "index": "not_analyzed"
                     },
                     "partial": {
                        "type": "string",
                        "index_analyzer": "partial_name",
                        "search_analyzer": "full_name"
                     }
                  }
               },
               "tags": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "title": {
                  "type": "string",
                  "analyzer": "full_name",
                  "fields": {
                     "partial": {
                        "type": "string",
                        "index_analyzer": "partial_name",
                        "search_analyzer": "full_name"
                     },
                     "sortable": {
                        "type": "string",
                        "analyzer": "sortable"
                     }
                  }
               },
               "variant_title": {
                  "type": "string",
                  "analyzer": "full_name",
                  "fields": {
                     "partial": {
                        "type": "string",
                        "index_analyzer": "partial_name",
                        "search_analyzer": "full_name"
                     },
                     "sortable": {
                        "type": "string",
                        "analyzer": "sortable"
                     }
                  }
               }
            }
         }
      }
   }
}

```

**Query DSL:**

```
{
  "from":0,
  "size":9,
  "min_score":0.005,
  "query":{
    "filtered":{
      "query":{
        "bool":{
          "should":[
            {
              "match":{
                "title":{
                  "query":"1-MTR",
                  "type":"phrase",
                  "boost":10
                }
              }
            },
            {
              "match":{
                "title":{
                  "query":"1-MTR",
                  "operator":"and",
                  "boost":5,
                  "fuzziness":"0"
                }
              }
            },
            {
              "match":{
                "title":{
                  "query":"1-MTR",
                  "boost":2,
                  "fuzziness":"AUTO"
                }
              }
            },
            {
              "match":{
                "title.partial":{
                  "query":"1-MTR",
                  "boost":5,
                  "fuzziness":"0"
                }
              }
            },
            {
              "multi_match":{
                "query":"1-MTR",
                "type":"cross_fields",
                "fields":[
                  "sku",
                  "sku.partial",
                  "variant_title",
                  "variant_title.partial"
                ],
                "boost":1
              }
            },
            {
              "term": {
                "sku.exact": {
                  "value": "1-MTR",
                  "boost": 200
                }
              }
            }
          ]
        }
      },
      "filter":{
        "bool": {
          "must": [
            {
              "exists":{
                  "field":"sbb"
              }
            }
          ]
        }
      }
    }
  }
}

```

**Expected example source result:**

```
{
     "_source": {
     "sku": "1-MTR",
     "title": "Afghanistan Campaign Tiny Ribbon ",
     "variant_title": "",
     "image": "401_ARACMR.jpg"
}
```

---

<div class="post-metadata">

**Author:** ![Zelfapp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zelfapp/32/108888_2.png) [@Zelfapp](https://discuss.elastic.co/u/Zelfapp)\
**Post date:** [August 4, 2015, 4:54pm UTC](https://discuss.elastic.co/t/boosting-sku-exact-not-analyzed-not-returning-expected-results/26817/2 "2015-08-04T16:54:11Z")

</div>

Wish I could delete this post. The issue has been resolved.

My query dsl and mapping are working correctly. The particular SKU I was searching for was missing the "sbb" field, which is a required filter.

Wooops! Maybe something here will be useful to someone else, or moderator, please delete.

---

<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:57pm UTC](https://discuss.elastic.co/t/boosting-sku-exact-not-analyzed-not-returning-expected-results/26817/3 "2017-07-05T23:57:28Z")

</div>


