Skip to content

Commit

Permalink
SAK-40894 limit the number of total sites to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff authored and Miguel Pellicer committed Nov 7, 2018
1 parent 395d304 commit 82e1af8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public static enum Scope {SITE, MINE};

private int nTerms = 100;

private int nSites = 1000;

private List<SearchTerm> finalTermList;

private int topTerms = 10;
Expand Down Expand Up @@ -444,7 +446,9 @@ protected List<String> getSearchSites (String[] toolPropertySiteIds) {
}
}
if (scope != null && scope.equals(Scope.MINE)) {
l.addAll(Arrays.asList(getAllUsersSites()));
List<String> allUserSites = Arrays.asList(getAllUsersSites());
List<String> trimmedUserSites = allUserSites.subList(0, Math.min(nSites, allUserSites.size()));
l.addAll(trimmedUserSites);
}

return l;
Expand Down
4 changes: 2 additions & 2 deletions search/search-tool/tool/src/webapp/WEB-INF/vm/index.vm
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<input type="text" id="search" name="search" size="42" maxlength="1024" value="${searchModel.search}"/>
<input type="submit" name="sb" value="${rlb.jsp_search}" />
<br/>
<input id="searchSite" type="radio" name="scope" value="SITE" #if($searchModel.isScope('SITE')) checked="true" #end "/>
<input id="searchSite" type="radio" name="scope" value="SITE" #if($searchModel.isScope('SITE')) checked="true" #end />
<label for="searchSite">${rlb.jsp_current_site}</label>
<input id="searchMine" type="radio" name="scope" value="MINE" #if($searchModel.isScope('MINE')) checked="true" #end "/>
<input id="searchMine" type="radio" name="scope" value="MINE" #if($searchModel.isScope('MINE')) checked="true" #end />
<label for="searchMine">${rlb.jsp_all_my_sites}</label>
</form>
#if (${searchModel.hasSuggestion()})
Expand Down

0 comments on commit 82e1af8

Please sign in to comment.