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;
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 );
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
return paginated;
}
-
- private static String getHitId( String groupId, String artifactId )
- {
- return groupId + ":" + artifactId;
- }
}
* under the License.
*/
-import org.apache.commons.lang.StringUtils;
-
/**
* SearchUtil - utility class for search.
*
*/
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;