aboutsummaryrefslogtreecommitdiff
path: root/dbstore/sql/feed/search.sql
diff options
context:
space:
mode:
Diffstat (limited to 'dbstore/sql/feed/search.sql')
-rw-r--r--dbstore/sql/feed/search.sql26
1 files changed, 14 insertions, 12 deletions
diff --git a/dbstore/sql/feed/search.sql b/dbstore/sql/feed/search.sql
index cb80470..bc3f946 100644
--- a/dbstore/sql/feed/search.sql
+++ b/dbstore/sql/feed/search.sql
@@ -2,10 +2,10 @@
-- FIXME: should this be moved to cve/search
SELECT COALESCE(json_group_array(json_object(
'cve_id', b.cve_id,
- 'nvd_cve_id', printf('CVE-%4d-%04d', b.cve_year, b.cve_num),
- 'description', d.value,
- 'v3_base_score', e.v3_base_score / 10.0,
- 'v3_severity', f.name,
+ 'nvd_id', c.nvd_id,
+ 'description', e.value,
+ 'v3_base_score', f.v3_base_score / 10.0,
+ 'v3_severity', g.name,
'rank', a.min_rank
)), '[]')
@@ -18,15 +18,17 @@ SELECT COALESCE(json_group_array(json_object(
) a
JOIN cves b
ON (b.cve_id = a.cve_id)
- JOIN cve_descriptions c
+ JOIN cve_nvd_ids c
ON (c.cve_id = b.cve_id)
- JOIN descriptions d
- ON (d.desc_id = c.desc_id)
- JOIN item_cvss_v3_impacts e
- ON (e.item_id = b.item_id)
- JOIN severities f
- ON (f.severity_id = e.v3_severity_id)
+ JOIN cve_descriptions d
+ ON (d.cve_id = b.cve_id)
+ JOIN descriptions e
+ ON (e.desc_id = d.desc_id)
+ JOIN item_cvss_v3_impacts f
+ ON (f.item_id = b.item_id)
+ JOIN severities g
+ ON (g.severity_id = f.v3_severity_id)
- WHERE d.lang = 'en'
+ WHERE e.lang LIKE 'en%'
ORDER BY a.min_rank;