# Completion suggester score for prefix search

**URL:** <https://discuss.elastic.co/t/completion-suggester-score-for-prefix-search/121971>\
**Category:** Elasticsearch\
**Created:** [March 1, 2018, 2:41am UTC](https://discuss.elastic.co/t/completion-suggester-score-for-prefix-search/121971 "2018-03-01T02:41:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Zhou](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Andy\_Zhou](https://discuss.elastic.co/u/Andy_Zhou)\
**Post date:** [March 1, 2018, 2:41am UTC](https://discuss.elastic.co/t/completion-suggester-score-for-prefix-search/121971/1 "2018-03-01T02:41:00Z")

</div>

I am trying to understand how the score works for completion suggester. When I tested with the prefix search, the score always returns 1.0.

Below is my testing:  
1): Create one index with suggest field:

```
PUT testidx
{
    "mappings": {
        "word" : {
            "properties" : {
                "suggest" : {
                    "type" : "completion"
                }
            }
        }
    }
}

```

2): Index three documents:

```
PUT testidx/word/1?refresh
{
    "suggest" : {
        "input": ["complementary", "come"]
    }
}

PUT testidx/word/2?refresh
{
    "suggest" : {
        "input": ["complementary"]
    }
}

PUT testidx/word/3?refresh
{
    "suggest" : {
        "input": ["complementary", "compile"]
    }
}

```

3): Execute the suggest search:

```
POST testidx/_search
{
    "suggest": {
        "word-suggest" : {
            "prefix" : "com",
            "completion" : {
                "field" : "suggest"
            }
        }
    }
}

```

And below is the result:

```
{
    "took": 58,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": 0,
        "hits": []
    },
    "suggest": {
        "word-suggest": [
            {
                "text": "com",
                "offset": 0,
                "length": 3,
                "options": [
                    {
                        "text": "come",
                        "_index": "testidx",
                        "_type": "word",
                        "_id": "1",
                        "_score": 1,
                        "_source": {
                            "suggest": {
                                "input": [
                                    "complementary",
                                    "come"
                                ]
                            }
                        }
                    },
                    {
                        "text": "compile",
                        "_index": "testidx",
                        "_type": "word",
                        "_id": "3",
                        "_score": 1,
                        "_source": {
                            "suggest": {
                                "input": [
                                    "complementary",
                                    "compile"
                                ]
                            }
                        }
                    },
                    {
                        "text": "complementary",
                        "_index": "testidx",
                        "_type": "word",
                        "_id": "2",
                        "_score": 1,
                        "_source": {
                            "suggest": {
                                "input": [
                                    "complementary"
                                ]
                            }
                        }
                    }
                ]
            }
        ]
    }
}

```

I am supposed the word "complementary" has higher score since there has more appearances for it, but it comes the same score with the "come" word. Could you please explain it? Thanks!

---

<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:** [March 29, 2018, 2:41am UTC](https://discuss.elastic.co/t/completion-suggester-score-for-prefix-search/121971/2 "2018-03-29T02:41:03Z")

</div>

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