From b68b602dd61f28b37d0abe1fde70e29303b43e7c Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 18 Mar 2022 21:56:00 -0400 Subject: dbstore/dbstore.go: CisaSearch(): json_group_array() aggregates rows in an arbitrary order, so use sort.Sort() to sort the results in ascending order --- dbstore/dbstore.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbstore/dbstore.go b/dbstore/dbstore.go index 08da511..a80aea6 100644 --- a/dbstore/dbstore.go +++ b/dbstore/dbstore.go @@ -11,6 +11,7 @@ import ( "github.com/pablotron/cvez/cpedict" "github.com/pablotron/cvez/cpematch" nvd_feed "github.com/pablotron/cvez/feed" + "sort" ) // sqlite3 backing store @@ -901,6 +902,9 @@ func (me DbStore) CisaSearch( return json.Unmarshal([]byte(s), &r) }) + // sort results by rank + sort.Sort(byRank(r)) + // return results return r, err } -- cgit v1.2.3