fix es query size issue

This commit is contained in:
cuiweiwei 2024-09-02 17:05:21 +08:00
parent f3665ba378
commit c5dce5046c
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From f7879d9eeb03e989885f2103d9b71d28e10fc31e Mon Sep 17 00:00:00 2001
From: cuiweiwei <cuiweiwei@inspur.com>
Date: Mon, 2 Sep 2024 16:32:37 +0800
Subject: [PATCH] =?UTF-8?q?es=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0size?=
=?UTF-8?q?=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apollo/database/proxy/cve.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/apollo/database/proxy/cve.py b/apollo/database/proxy/cve.py
index eac1af0..3fbf3df 100644
--- a/apollo/database/proxy/cve.py
+++ b/apollo/database/proxy/cve.py
@@ -1174,6 +1174,7 @@ class CveProxy(CveMysqlProxy, CveEsProxy):
"""
query_body = self._general_body()
query_body['query']['bool']['must'].append({"terms": {"_id": cve_list}})
+ query_body['size'] = len(cve_list)
operation_code, res = self.query(CVE_INDEX, query_body, source=True)
if not operation_code:
--
2.39.5 (Apple Git-154)

View File

@ -1,6 +1,6 @@
Name: aops-apollo
Version: v1.4.1
Release: 4
Release: 5
Summary: Cve management service, monitor machine vulnerabilities and provide fix functions.
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
@ -11,6 +11,7 @@ Patch0003: 0003-update-verification-method-for-host-ip-fieldl.patch
Patch0004: 0004-fix-TimedCorrectTask.patch
Patch0005: 0005-add-reboot-field-to-query-host-info-api.patch
Patch0006: 0006-fix-bug-with-host-count-in-cve-fix-task.patch
Patch0007: 0007-fix-es-query-size-issue.patch
BuildRequires: python3-setuptools
Requires: aops-vulcanus >= v1.3.0
@ -73,6 +74,9 @@ popd
%{python3_sitelib}/aops_apollo_tool/*
%changelog
* Mon Sep 02 2024 cuiweiwei<cuiweiwei@inspur.com> - v1.4.1-5
- fix es query size issue
* Wed Jul 24 2024 wenxin<wenxin32@foxmail.com> - v1.4.1-4
- fix bug with host count in cve fix task