From: Maria Odea B. Ching Date: Tue, 8 Jul 2008 11:20:11 +0000 (+0000) Subject: [MRM-730] X-Git-Tag: archiva-1.1^2~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d428ccfd10d96868cd669a184f8e6b020632327;p=archiva.git [MRM-730] -search bytecode index if not found in filecontent index git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@674768 13f79535-47bb-0310-9956-ffa450edef68 --- 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 selectedRepos, String term, SearchResultLimits limits ) { - List indexes = getHashcodeIndexes( principal, selectedRepos ); + List 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; }