code: private void addSortOrder(SearchRequestBuilder builder, KunderaQuery query, EntityMetadata entityMetadata)
      {
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                  .getMetamodel(entityMetadata.getPersistenceUnit());
  
          List<OrderByItem> orderList = KunderaQueryUtils.getOrderByItems(query.getJpqlExpression());
  
          for (OrderByItem orderByItem : orderList)
          {
              String ordering = orderByItem.getOrdering().toString();
  
              if (ordering.equalsIgnoreCase(ESConstants.DEFAULT))
              {
                  ordering = Expression.ASC;
              }
  
              builder.addSort(KunderaCoreUtils.getJPAColumnName(orderByItem.getExpression().toParsedText(),
                      entityMetadata, metaModel), SortOrder.valueOf(ordering));
          }
      }
docs: Adds the sort order.
  
  @param builder
  the builder
  @param query
  the query
  @param entityMetadata
  the entity metadata