Commit edffaf4a authored by Markus Opolka's avatar Markus Opolka
Browse files

Sort feature search result list

parent 33529b92
......@@ -192,7 +192,8 @@ app.get('/api/features/:letter?', function (req, res) {
}
console.timeEnd('> Search Features')
}
res.send(data)
res.send(data.sort(lib.compare))
})
app.get('/api/letters/:letter?', function (req, res) {
......
......@@ -150,5 +150,12 @@ module.exports = {
},
search: function (obj, query) {
return searchInDocument(obj, query)
},
compare: function (a, b) {
if (a.hits > b.hits)
return -1
if (a.hits < b.hits)
return 1
return 0
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment