diff options
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java index 9898640cb76..b11bda5e624 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -270,6 +270,9 @@ public class SearchAction implements BaseIssuesWsAction { public final void handle(Request request, Response response) throws Exception { SearchOptions options = new SearchOptions(); options.setPage(request.mandatoryParamAsInt(WebService.Param.PAGE), request.mandatoryParamAsInt(WebService.Param.PAGE_SIZE)); + if (shouldIgnorePaging(request)) { + options.disableLimit(); + } options.addFacets(request.paramAsStrings(WebService.Param.FACETS)); IssueQuery query = issueQueryService.createFromRequest(request); @@ -286,6 +289,13 @@ public class SearchAction implements BaseIssuesWsAction { json.endObject().close(); } + private boolean shouldIgnorePaging(Request request) { + List<String> componentUuids = request.paramAsStrings(IssueFilterParameters.COMPONENT_UUIDS); + // Paging can be ignored only when querying issues for a single component (e.g in component viewer) + return componentUuids != null && componentUuids.size() == 1 + && BooleanUtils.isTrue(request.paramAsBoolean(IssueFilterParameters.IGNORE_PAGING)); + } + private SearchResult<IssueDoc> execute(IssueQuery query, SearchOptions options) { Collection<String> components = query.componentUuids(); if (components != null && components.size() == 1 && BooleanUtils.isTrue(query.ignorePaging())) { |