]> source.dussan.org Git - archiva.git/commitdiff
[MRM-730]
authorMaria Odea B. Ching <oching@apache.org>
Tue, 8 Jul 2008 11:20:11 +0000 (11:20 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Tue, 8 Jul 2008 11:20:11 +0000 (11:20 +0000)
-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

archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java

index 98490ebe407d7b1fef6318ce79828afc75dd450e..3ff9547959c56fa03e5f4449148362bb834a51ab 100644 (file)
@@ -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;
         }