Map<String, String[]> queryMap = createQueryMap( request.getMetadata() );
DateQuery[] dates = createDateQueryForRepository( request );
long start = System.currentTimeMillis();
AssetItemIterator iterator = rulesRepository.query( queryMap,
request.isSearchArchived(),
dates );
log.debug( "Search time: " + (System.currentTimeMillis() - start) );
List<QueryPageRow> rowList = new QueryMetadataPageRowBuilder()
.withPageRequest( request )
.withIdentity( identity )
.withContent( iterator )
.build();
boolean bHasMoreRows = iterator.hasNext();
PageResponse<QueryPageRow> response = new PageResponseBuilder<QueryPageRow>()
.withStartRowIndex( request.getStartRowIndex() )
.withPageRowList( rowList )
.withLastPage( !bHasMoreRows )
.buildWithTotalRowCount( -1 );//its impossible to know the exact selected count until we'v reached