简体   繁体   English

如何在 sonarqube 上获得 10,000 多个问题

[英]How to get more than 10,000 issues on sonarqube

I am working on a requirement where we need to generate issues reports and export them in excel.我正在处理一个需要生成问题报告并将其导出到 excel 的需求。 The number of issues that are generated in the project exceed the limit of 10,000 records that are allowed by sonarqube API.项目中产生的问题数量超过了 sonarqube API 允许的10,000条记录的限制。 I want to get all the issues and export them but when I try to get more than 10,000 records I get below response:我想获取所有问题并将它们导出,但是当我尝试获取 10,000 多条记录时,我得到以下响应:

{
"errors": [
  {
    "msg": "Can return only the first 10000 results. 12000th result asked."
  }
 ]
}

This makes sense as the API has a limit to return first 10,000 issues.这是有道理的,因为 API 有返回前 10,000 个问题的限制。 Request URL is http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120 where p=pageNumber请求 URL 是http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120其中 p=pageNumber

Is there any workaround by which I can get all the issues?是否有任何解决方法可以解决所有问题?

When there are more than 10000 results, the only way to get the rest is to split your query to multiple, more refined queries with more strict filters, such that each query returns less than 10000 results.当有超过 10000 个结果时,获得其余结果的唯一方法是将您的查询拆分为多个、具有更严格过滤器的更精细的查询,以便每个查询返回的结果少于 10000 个。 And then combine the query results to obtain your complete target result set.然后结合查询结果得到你完整的目标结果集。

This limitation to 10000 results applies to web services that are backed by ElasticSearch index, and there's just no way around it.这种对 10000 个结果的限制适用于由 ElasticSearch 索引支持的 Web 服务,而且没有办法绕过它。

As reported by the error, it's not possible to browse more than 10.000 issues.正如错误所报告的那样,浏览超过 10.000 个问题是不可能的。 You need to refine your search.您需要优化您的搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM