code: public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
        QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
     {
        waitForResuming();
  
        checkOpen();
  
        workingThreads.incrementAndGet();
  
        try
        {
           FieldComparatorSource scs = queryImpl.isCaseInsensitiveOrder() ? this.sics : this.scs;
           Sort sort = new Sort(createSortFields(orderProps, orderSpecs, scs));
           final IndexReader reader = getIndexReader(queryImpl.needsSystemTree());
           @SuppressWarnings("resource")
           JcrIndexSearcher searcher = new JcrIndexSearcher(session, reader, getContext().getItemStateManager());
           searcher.setSimilarity(getSimilarity());
           return new FilterMultiColumnQueryHits(searcher.execute(query, sort, resultFetchHint,
              QueryImpl.DEFAULT_SELECTOR_NAME))
           {
              @Override
              public void close() throws IOException
              {
                 try
                 {
                    super.close();
                 }
                 finally
                 {
                    PerQueryCache.getInstance().dispose();
                    Util.closeOrRelease(reader);
                 }
              }
           };
        }
        finally
        {
           workingThreads.decrementAndGet();
  
           if (isSuspended.get() && workingThreads.get() == 0)
           {
              synchronized (workingThreads)
              {
                 workingThreads.notifyAll();
              }
           }
        }
     }
docs: Executes the query on the search index.
  
  @param session
  the session that executes the query.
  @param queryImpl
  the query impl.
  @param query
  the lucene query.
  @param orderProps
  name of the properties for sort order.
  @param orderSpecs
  the order specs for the sort order properties.
  <code>true</code> indicates ascending order,
  <code>false</code> indicates descending.
  @param resultFetchHint
  a hint on how many results should be fetched.
  @return the query hits.
  @throws IOException
  if an error occurs while searching the index.
  @throws RepositoryException