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
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"
}
}
}
}