Reverting earlier change to SearchUtil

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@742863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James William Dumay 2009-02-10 06:12:32 +00:00
parent 6267a21d29
commit f3e319b018
2 changed files with 3 additions and 41 deletions

View File

@ -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<String, SearchResultHit> 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;
}
}

View File

@ -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;