code: public QueryResult execute(long offset, long limit, boolean caseInsensitiveOrder) throws RepositoryException
     {
        if (log.isDebugEnabled())
        {
           log.debug("Executing query: \n" + root.dump());
        }
        
        setCaseInsensitiveOrder(caseInsensitiveOrder);
  
        // build lucene query
        Query query =
           LuceneQueryBuilder.createQuery(root, session, index.getContext().getItemStateManager(),
              index.getNamespaceMappings(), index.getTextAnalyzer(), propReg, index.getSynonymProvider(),
              index.getIndexFormatVersion(), index.getContext().getVirtualTableResolver(), index.getIndexingConfig());
  
        OrderQueryNode orderNode = root.getOrderNode();
  
        OrderQueryNode.OrderSpec[] orderSpecs;
        if (orderNode != null)
        {
           orderSpecs = orderNode.getOrderSpecs();
        }
        else
        {
           orderSpecs = new OrderQueryNode.OrderSpec[0];
        }
        QPath[] orderProperties = new QPath[orderSpecs.length];
        boolean[] ascSpecs = new boolean[orderSpecs.length];
        for (int i = 0; i < orderSpecs.length; i++)
        {
           orderProperties[i] = orderSpecs[i].getPropertyPath();
           ascSpecs[i] = orderSpecs[i].isAscending();
        }
  
        return new SingleColumnQueryResult(index, itemMgr, session, session.getAccessManager(), this, query,
           new SpellSuggestion(index.getSpellChecker(), root), getSelectProperties(), orderProperties, ascSpecs,
           orderProperties.length == 0 && getRespectDocumentOrder(), offset, limit);
     }
docs: {@inheritDoc}