Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Implemented proper collapseOverride
Browse files Browse the repository at this point in the history
git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk@6662 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
cstamas committed Jun 22, 2010
1 parent 5277af2 commit 02ef831
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -182,6 +182,16 @@ public Object get( Context context, Request request, Response response, Variant
else
{
result.setData( new ArrayList<NexusArtifact>( ai2NaColl( request, searchResult.getResults() ) ) );

// if we had collapseResults ON, and the totalHits are larger than actual (filtered) results, and
// the actual result count is below COLLAPSE_OVERRIDE_TRESHOLD, then repeat without collapse
if ( collapseResults && result.getData().size() < searchResult.getTotalHits()
&& result.getData().size() < COLLAPSE_OVERRIDE_TRESHOLD )
{
collapseResults = false;

continue;
}
}

// we came here, so we break the while-loop, we got what we need
Expand Down

0 comments on commit 02ef831

Please sign in to comment.