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
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();
}
searchField.setGroupId( groupId );
searchField.setArtifactId( artifactId );
searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
+ searchField.setRepositories( getObservableRepos() );
try
{