code: private void collectScoreNodes(MultiColumnQueryHits hits, List<ScoreNode[]> collector, long maxResults, boolean isOffset) throws IOException,
        RepositoryException
     {
        while (collector.size() < maxResults)
        {
           ScoreNode[] sn = hits.nextScoreNodes();
           if (sn == null)
           {
              // no more results
              break;
           }
           // check access
           if ((!docOrder && !isOffset ) || isAccessGranted(sn))
           {
              collector.add(sn);
           }
           else
           {
              invalid++;
           }
        }
     }
docs: Collect score nodes from <code>hits</code> into the <code>collector</code>
  list until the size of <code>collector</code> reaches <code>maxResults</code>
  or there are not more results.
  
  @param hits the raw hits.
  @param collector where the access checked score nodes are collected.
  @param maxResults the maximum number of results in the collector.
  @param isOffset if true the access is checked for the offset result.
  @throws IOException if an error occurs while reading from hits.
  @throws RepositoryException if an error occurs while checking access rights.