summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-10-14 17:49:30 +0000
committerOlivier Lamy <olamy@apache.org>2011-10-14 17:49:30 +0000
commitd33893087638984f4c9081bc8985198ebced94fd (patch)
tree238ea041490533a8e2b93e06b7a75d1d7810573d
parent08d61568b72b9e652a47edc6df4a4f8372dcc865 (diff)
downloadarchiva-d33893087638984f4c9081bc8985198ebced94fd.tar.gz
archiva-d33893087638984f4c9081bc8985198ebced94fd.zip
if searching with SearchFields with unknown repo ids do not revert to a search on all index.
small changes on previous commit: only if SearchFields has repos set to not break previous behaviour. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1183443 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java4
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java1
2 files changed, 3 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
index cd0b7fd30..f705048e4 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java
@@ -141,9 +141,9 @@ public class NexusRepositorySearch
List<String> indexingContextIds = addIndexingContexts(searchFields.getRepositories());
- // if no index found in the specified one return an empty search result instead of doing a search on all index
+ // if no index found in the specified ones return an empty search result instead of doing a search on all index
// olamy: IMHO doesn't make sense
- if (indexingContextIds == null || indexingContextIds.isEmpty() )
+ if ( !searchFields.getRepositories().isEmpty() && (indexingContextIds == null || indexingContextIds.isEmpty()) )
{
return new SearchResults();
}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
index e6aec78fd..cc7b60690 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
@@ -105,6 +105,7 @@ public class DefaultSearchService
searchField.setGroupId( groupId );
searchField.setArtifactId( artifactId );
searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
+ searchField.setRepositories( getObservableRepos() );
try
{