summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
diff options
context:
space:
mode:
authorPaul Martin <paul@paulsputer.com>2016-04-16 19:46:30 +0100
committerPaul Martin <paul@paulsputer.com>2016-04-16 19:46:30 +0100
commit4acd8c1a8b02ff55872069fb84403993bbb7cb69 (patch)
tree8deb736640afbd4c338bef0b1595beed2cffe117 /src/main/java/com
parent76e18a87471ec487304eb13dc8a5d362585b4f1c (diff)
parentb674fed230bcd6488b796f49de5505cbaf448b07 (diff)
downloadgitblit-4acd8c1a8b02ff55872069fb84403993bbb7cb69.tar.gz
gitblit-4acd8c1a8b02ff55872069fb84403993bbb7cb69.zip
Merge pull request #1060 from gitblit/966-Searching-Always-Over-All-Repositories
fixes #966 to prevent always searching all repos
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.java9
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;