# Suggesters Sort for Weight?

**URL:** <https://discuss.elastic.co/t/suggesters-sort-for-weight/215798>\
**Category:** Elasticsearch\
**Created:** [January 20, 2020, 9:31pm UTC](https://discuss.elastic.co/t/suggesters-sort-for-weight/215798 "2020-01-20T21:31:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliuFlorez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliuflorez/32/40884_2.png) [@EliuFlorez](https://discuss.elastic.co/u/EliuFlorez)\
**Post date:** [January 20, 2020, 9:31pm UTC](https://discuss.elastic.co/t/suggesters-sort-for-weight/215798/1 "2020-01-20T21:31:46Z")

</div>

Hi guys, can a query bring the result of my suggestion by weight? that is to say to weight I want to place the total of listings existing then suggesters would be ordered from the weight it contains?

Ready

```auto
PUT test
{
    "mappings": {
        "properties" : {
            "suggest" : {
                "type" : "completion"
            },
            "title" : {
                "type": "keyword"
            }
        }
    }
}

PUT test/_doc/1?refresh
{
    "suggest" : [
        {
            "input": "test-10",
            "weight" : 10
        }
    ]
}

PUT test/_doc/2?refresh
{
    "suggest" : [
        {
            "input": "test-2",
            "weight" : 2
        }
    ]
}

PUT test/_doc/3?refresh
{
    "suggest" : [
        {
            "input": "test-3",
            "weight" : 3
        }
    ]
}

PUT test/_doc/4?refresh
{
    "suggest" : [
        {
            "input": "test-100",
            "weight" : 100
        }
    ]
}

POST test/_search?pretty
{
    "suggest": {
        "song-suggest" : {
            "prefix" : "test", 
            "completion" : { 
                "field" : "suggest" 
            }
        }
    }
}

```

---

<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:** [February 17, 2020, 9:31pm UTC](https://discuss.elastic.co/t/suggesters-sort-for-weight/215798/2 "2020-02-17T21:31:46Z")

</div>

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