# Search analyzer score is not matching

**URL:** <https://discuss.elastic.co/t/search-analyzer-score-is-not-matching/124120>\
**Category:** Elasticsearch\
**Created:** [March 15, 2018, 2:55pm UTC](https://discuss.elastic.co/t/search-analyzer-score-is-not-matching/124120 "2018-03-15T14:55:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoangvnit](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hoangvnit](https://discuss.elastic.co/u/hoangvnit)\
**Post date:** [March 15, 2018, 2:55pm UTC](https://discuss.elastic.co/t/search-analyzer-score-is-not-matching/124120/1 "2018-03-15T14:55:56Z")

</div>

i have data below

- coconut oil
- liquid coconut oil
- Nutiva Coconut Oil
- Kelapo Coconut Oil
- coconut oil spray

when i searching "coconut oil", i want to the first result is "coconut oil"  
but now "liquid coconut oil" have hight score. and result is wrong.  
i don't know why.

anyone can help me. thank you so much.

this is my query

```
GET collection/_search
{
  
  "query": {
    "match": {
      "ingredient": {
        "query": "coconut oil", 
        "operator": "or"
      }
    }
  },
  "sort": [
    {
      "_score": {
        "order": "desc"
      }
    }
  ]
  
}

```

this is my mapping

```
PUT collection
{
  "settings": {
    "analysis": {
      "filter": {
        "autocomplete_filter": {
          "type": "edge_ngram",
          "min_gram": 3,
          "max_gram": 7
        }
      },
      "analyzer": {
        "autocomplete": { 
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "autocomplete_filter"
          ]
        }
      }
    }
  },
  "mappings": {
    "data": {
      "properties": {
        "id" : { "type" : "integer"},
        "ingredient": {
          "type": "text",
          "analyzer": "autocomplete", 
          "search_analyzer": "standard" 
        }
      }
    }
  }
}
```

---

<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:** [April 12, 2018, 2:56pm UTC](https://discuss.elastic.co/t/search-analyzer-score-is-not-matching/124120/2 "2018-04-12T14:56:05Z")

</div>

Closed on April 12, 2018, 2:56pm UTC

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