@Deprecated public FlatSearchResponse searchArtifactClassFlat(String term, String repositoryId, Integer from, Integer count, Integer hitLimit) throws NoSuchRepositoryException { if (term.endsWith(".class")) { term = term.substring(0, term.length() - 6); } Query q = mavenIndexer.constructQuery(MAVEN.CLASSNAMES, term, SearchType.SCORED); FlatSearchRequest req = new FlatSearchRequest(q, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR); // if ( from != null ) // { // req.setStart( from ); // } // MINDEXER-14: no hit limit anymore. But to make change least obtrusive, we set hitLimit as count 1st, and if // user set count, it will override it anyway if (hitLimit != null) { req.setCount(hitLimit); } if (count != null) { req.setCount(count); } // if ( hitLimit != null ) // { // req._setResultHitLimit( hitLimit ); // } return searchFlat(repositoryId, req); }
@Deprecated public FlatSearchResponse searchArtifactFlat(String term, String repositoryId, Integer from, Integer count, Integer hitLimit) throws NoSuchRepositoryException { Query q1 = mavenIndexer.constructQuery(MAVEN.GROUP_ID, term, SearchType.SCORED); Query q2 = mavenIndexer.constructQuery(MAVEN.ARTIFACT_ID, term, SearchType.SCORED); BooleanQuery bq = new BooleanQuery(); bq.add(q1, BooleanClause.Occur.SHOULD); bq.add(q2, BooleanClause.Occur.SHOULD); FlatSearchRequest req = new FlatSearchRequest(bq, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR); // if ( from != null ) // { // req.setStart( from ); // } // MINDEXER-14: no hit limit anymore. But to make change least obtrusive, we set hitLimit as count 1st, and if // user set count, it will override it anyway if (hitLimit != null) { req.setCount(hitLimit); } if (count != null) { req.setCount(count); } // if ( hitLimit != null ) // { // req._setResultHitLimit( hitLimit ); // } return searchFlat(repositoryId, req); }
request.setCount( limits.getPageSize() * ( Math.max( 1, limits.getSelectedPage() ) ) );
request.setCount( limits.getPageSize() * ( Math.max( 1, limits.getSelectedPage() ) ) );