diff options
-rw-r--r-- | archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java index 98490ebe4..3ff954795 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java @@ -100,7 +100,7 @@ public class DefaultCrossRepositorySearch public SearchResults searchForBytecode( String principal, List<String> selectedRepos, String term, SearchResultLimits limits ) { - List<RepositoryContentIndex> indexes = getHashcodeIndexes( principal, selectedRepos ); + List<RepositoryContentIndex> indexes = getBytecodeIndexes( principal, selectedRepos ); try { @@ -130,6 +130,11 @@ public class DefaultCrossRepositorySearch LuceneQuery query = new LuceneQuery( parser.parse( term ) ); SearchResults results = searchAll( query, limits, indexes ); results.getRepositories().addAll( this.localIndexedRepositories ); + + if( results.getTotalHits() == 0 ) + { + results = searchForBytecode( principal, selectedRepos, term, limits ); + } return results; } |