From: James William Dumay Date: Tue, 10 Feb 2009 06:12:32 +0000 (+0000) Subject: Reverting earlier change to SearchUtil X-Git-Tag: archiva-1.2~138 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f3e319b018a0d48de6f1baafc9f0fb93ca4ca9b0;p=archiva.git Reverting earlier change to SearchUtil git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@742863 13f79535-47bb-0310-9956-ffa450edef68 --- 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 597d97855..cdf73f48a 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 @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.apache.archiva.indexer.util.SearchUtil; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.maven.archiva.configuration.ArchivaConfiguration; @@ -247,7 +248,7 @@ public class NexusRepositorySearch for ( ArtifactInfo artifactInfo : artifactInfos ) { - String id = getHitId( artifactInfo.groupId, artifactInfo.artifactId ); + String id = SearchUtil.getHitId( artifactInfo.groupId, artifactInfo.artifactId ); Map hitsMap = results.getHitsMap(); SearchResultHit hit = hitsMap.get( id ); @@ -313,7 +314,7 @@ public class NexusRepositorySearch SearchResultHit hit = results.getHits().get( ( offset + i ) ); if( hit != null ) { - String id = getHitId( hit.getGroupId(), hit.getArtifactId() ); + String id = SearchUtil.getHitId( hit.getGroupId(), hit.getArtifactId() ); paginated.addHit( id, hit ); } else @@ -327,9 +328,4 @@ public class NexusRepositorySearch return paginated; } - - private static String getHitId( String groupId, String artifactId ) - { - return groupId + ":" + artifactId; - } } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java index 3e1e7627e..cd15df2de 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/util/SearchUtil.java @@ -19,8 +19,6 @@ package org.apache.archiva.indexer.util; * under the License. */ -import org.apache.commons.lang.StringUtils; - /** * SearchUtil - utility class for search. * @@ -28,38 +26,6 @@ import org.apache.commons.lang.StringUtils; */ public class SearchUtil { - public static final String BYTECODE_KEYWORD = "bytecode:"; - - /** - * Determines whether the queryString has the bytecode keyword. - * - * @param queryString - * @return - */ - public static boolean isBytecodeSearch( String queryString ) - { - if ( queryString.startsWith( BYTECODE_KEYWORD ) ) - { - return true; - } - - return false; - } - - /** - * Removes the bytecode keyword from the query string. - * - * @param queryString - * @return - */ - public static String removeBytecodeKeyword( String queryString ) - { - String qString = StringUtils.uncapitalize( queryString ); - qString = StringUtils.remove( queryString, BYTECODE_KEYWORD ); - - return qString; - } - public static String getHitId( String groupId, String artifactId ) { return groupId + ":" + artifactId;