diff options
author | Paul Martin <paul@paulsputer.com> | 2016-04-16 16:41:45 +0100 |
---|---|---|
committer | Paul Martin <paul@paulsputer.com> | 2016-04-16 16:41:45 +0100 |
commit | b674fed230bcd6488b796f49de5505cbaf448b07 (patch) | |
tree | 8deb736640afbd4c338bef0b1595beed2cffe117 /src | |
parent | 76e18a87471ec487304eb13dc8a5d362585b4f1c (diff) | |
download | gitblit-b674fed230bcd6488b796f49de5505cbaf448b07.tar.gz gitblit-b674fed230bcd6488b796f49de5505cbaf448b07.zip |
fixes #966 to prevent always searching all repos
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java b/src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java index b2fd9037..1d81061e 100644 --- a/src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java +++ b/src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java @@ -66,6 +66,8 @@ public class LuceneSearchPage extends RootPage { // default values
ArrayList<String> repositories = new ArrayList<String>();
String query = "";
+ boolean allRepos = false;
+
int page = 1;
int pageSize = app().settings().getInteger(Keys.web.itemsPerPage, 50);
@@ -91,8 +93,9 @@ public class LuceneSearchPage extends RootPage { List<String> list = StringUtils.getStringsFromValue(value);
repositories.addAll(list);
}
- - if (params.containsKey("allrepos")) {
+
+ allRepos = params.getAsBoolean("allrepos", false); + if (allRepos) {
repositories.addAll(availableRepositories);
}
@@ -133,7 +136,7 @@ public class LuceneSearchPage extends RootPage { // search form
final Model<String> queryModel = new Model<String>(query);
final Model<ArrayList<String>> repositoriesModel = new Model<ArrayList<String>>(searchRepositories);
- final Model<Boolean> allreposModel = new Model<Boolean>(params != null && params.containsKey("allrepos"));
+ final Model<Boolean> allreposModel = new Model<Boolean>(allRepos);
SessionlessForm<Void> form = new SessionlessForm<Void>("searchForm", getClass()) {
private static final long serialVersionUID = 1L;
|