Query query =
LuceneQueryBuilder.createQuery(root, session, index.getContext().getItemStateManager(), index
.getNamespaceMappings(), index.getContext().getNodeTypeDataManager(), index.getTextAnalyzer(),
propReg, index.getSynonymProvider(), index.getIndexFormatVersion());
OrderQueryNode orderNode = root.getOrderNode();
OrderQueryNode.OrderSpec[] orderSpecs;
if (orderNode != null)
{
orderSpecs = orderNode.getOrderSpecs();
}
else
{
orderSpecs = new OrderQueryNode.OrderSpec[0];
}