mirror of https://github.com/apache/archiva.git
moved hit key utility method
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@742848 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
837bb4a0b6
commit
dc5aee4038
|
@ -25,7 +25,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.archiva.indexer.util.SearchUtil;
|
|
||||||
import org.apache.lucene.search.BooleanQuery;
|
import org.apache.lucene.search.BooleanQuery;
|
||||||
import org.apache.lucene.search.BooleanClause.Occur;
|
import org.apache.lucene.search.BooleanClause.Occur;
|
||||||
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
|
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
|
||||||
|
@ -248,7 +247,7 @@ public class NexusRepositorySearch
|
||||||
|
|
||||||
for ( ArtifactInfo artifactInfo : artifactInfos )
|
for ( ArtifactInfo artifactInfo : artifactInfos )
|
||||||
{
|
{
|
||||||
String id = SearchUtil.getHitId( artifactInfo.groupId, artifactInfo.artifactId );
|
String id = getHitId( artifactInfo.groupId, artifactInfo.artifactId );
|
||||||
Map<String, SearchResultHit> hitsMap = results.getHitsMap();
|
Map<String, SearchResultHit> hitsMap = results.getHitsMap();
|
||||||
|
|
||||||
SearchResultHit hit = hitsMap.get( id );
|
SearchResultHit hit = hitsMap.get( id );
|
||||||
|
@ -314,7 +313,7 @@ public class NexusRepositorySearch
|
||||||
SearchResultHit hit = results.getHits().get( ( offset + i ) );
|
SearchResultHit hit = results.getHits().get( ( offset + i ) );
|
||||||
if( hit != null )
|
if( hit != null )
|
||||||
{
|
{
|
||||||
String id = SearchUtil.getHitId( hit.getGroupId(), hit.getArtifactId() );
|
String id = getHitId( hit.getGroupId(), hit.getArtifactId() );
|
||||||
paginated.addHit( id, hit );
|
paginated.addHit( id, hit );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -328,5 +327,9 @@ public class NexusRepositorySearch
|
||||||
|
|
||||||
return paginated;
|
return paginated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getHitId( String groupId, String artifactId )
|
||||||
|
{
|
||||||
|
return groupId + ":" + artifactId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue