如何在声纳波上获得超过10,000个问题 [英] How to get more than 10,000 issues on sonarqube

查看:197
本文介绍了如何在声纳波上获得超过10,000个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一项需求,我们需要生成问题报告并将其导出为ex​​cel.项目中生成的问题数量超过了sonarqube API所允许的 10,000 个记录的限制.我想获取所有问题并导出它们,但是当我尝试获取超过10,000条记录时,得到的响应如下:

I am working on a requirement where we need to generate issues reports and export them in excel. The number of issues that are generated in the project exceed the limit of 10,000 records that are allowed by sonarqube API. 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:

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

这很有道理,因为API限制了返回前10,000个问题的限制.请求URL是 http://localhost:9000/api/issues/search?pageSize = 100& componentKeys = aug06_01& p = 120 其中p = pageNumber

This makes sense as the API has a limit to return first 10,000 issues. Request URL is http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120 where p=pageNumber

有什么解决方法可以解决所有问题?

Is there any workaround by which I can get all the issues?

推荐答案

当结果超过10000个时,获得其余结果的唯一方法是将您的查询拆分为多个更精细的查询,并使用更严格的过滤器,例如每个查询返回的结果少于10000.然后结合查询结果以获得完整的目标结果集.

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. And then combine the query results to obtain your complete target result set.

此结果限制为10000个结果,适用于以ElasticSearch索引为后盾的Web服务,并且没有办法解决.

This limitation to 10000 results applies to web services that are backed by ElasticSearch index, and there’s just no way around it.

这篇关于如何在声纳波上获得超过10,000个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆