protected void getResults(long size) throws RepositoryException
   {
      if (LOG.isDebugEnabled())
      {
         LOG.debug("getResults({}) limit={}", new Long(size), new Long(limit));
      }

      long maxResultSize = size;

      // is there any limit?
      if (limit > 0)
      {
         maxResultSize = limit;
      }

      if (resultNodes.size() >= maxResultSize)
      {
         // we already have them all
         return;
      }

      // execute it
      MultiColumnQueryHits result = null;
      try
      {
         long time = 0;
         if (LOG.isDebugEnabled())
         {
            time = System.currentTimeMillis();
         }
         result = executeQuery(maxResultSize);
         if (LOG.isDebugEnabled())
         {
            LOG.debug("query executed in {} ms", new Long(System.currentTimeMillis() - time));
         }
         // set selector names
         selectorNames = result.getSelectorNames();

         if (resultNodes.isEmpty() && offset > 0)
         {
            // collect result offset into dummy list
            collectScoreNodes(result, new ArrayList<ScoreNode[]>(), offset, true);
         }
         else
         {
            int start = resultNodes.size() + invalid + (int)offset;
            result.skip(start);
         }

         if (LOG.isDebugEnabled())
         {
            time = System.currentTimeMillis();
         }
         collectScoreNodes(result, resultNodes, maxResultSize,false);
         if (LOG.isDebugEnabled())
         {
            LOG.debug("retrieved ScoreNodes in {} ms", new Long(System.currentTimeMillis() - time));
         }

         // update numResults
         numResults = result.getSize();
      }
      catch (IndexOfflineIOException e)
      {
         throw new IndexOfflineRepositoryException(e.getMessage(), e);
      }
      catch (IOException e)
      {
         throw new RepositoryException("Exception while executing query: ", e);
      }
      finally
      {
         if (result != null)
         {
            try
            {
               result.close();
            }
            catch (IOException e)
            {
               LOG.warn("Unable to close query result: " + e);
            }
         }
      }
   }
protected void getResults ( long size ) throws RepositoryException { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "getResults({}) limit={}" , new Long ( size ) , new Long ( limit ) ) ; } long maxResultSize = size ; if ( limit > 0 ) { maxResultSize = limit ; } if ( resultNodes . size ( ) >= maxResultSize ) { return ; } MultiColumnQueryHits result = null ; try { long time = 0 ; if ( LOG . isDebugEnabled ( ) ) { time = System . currentTimeMillis ( ) ; } result = executeQuery ( maxResultSize ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "query executed in {} ms" , new Long ( System . currentTimeMillis ( ) - time ) ) ; } selectorNames = result . getSelectorNames ( ) ; if ( resultNodes . isEmpty ( ) && offset > 0 ) { collectScoreNodes ( result , new ArrayList < ScoreNode [ ] > ( ) , offset , true ) ; } else { int start = resultNodes . size ( ) + invalid + ( int ) offset ; result . skip ( start ) ; } if ( LOG . isDebugEnabled ( ) ) { time = System . currentTimeMillis ( ) ; } collectScoreNodes ( result , resultNodes , maxResultSize , false ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "retrieved ScoreNodes in {} ms" , new Long ( System . currentTimeMillis ( ) - time ) ) ; } numResults = result . getSize ( ) ; } catch ( IndexOfflineIOException e ) { throw new IndexOfflineRepositoryException ( e . getMessage ( ) , e ) ; } catch ( IOException e ) { throw new RepositoryException ( "Exception while executing query: " , e ) ; } finally { if ( result != null ) { try { result . close ( ) ; } catch ( IOException e ) { LOG . warn ( "Unable to close query result: " + e ) ; } } } }
Attempts to get <code>size</code> results and puts them into {@link
#resultNodes}. If the size of {@link #resultNodes} is less than
<code>size</code> then there are no more than <code>resultNodes.size()</code>
results for this query.

@param size the number of results to fetch for the query.
@throws RepositoryException if an error occurs while executing the
query.