docs: function orderBy() {
    /*jshint validthis:true */
    var self = (this instanceof QueryBuilder) ? this : new QueryBuilder();
  
    var args = mlutil.asArray.apply(null, arguments);
    // TODO: if empty, clear the clause
  
    var sortOrder = [];
  
    var scoreOption    = null;
    var scoreDirection = null;
  
    var arg = null;
    for (var i=0; i < args.length; i++) {
      arg = args[i];
      if (typeof arg === 'string' || arg instanceof String) {
        sortOrder.push(sort(arg));
      } else {
        if (scoreOption === null) {
          scoreOption = arg.score;
          if (typeof scoreOption === 'string' || scoreOption instanceof String) {
            scoreOption = 'score-'+scoreOption;
            scoreDirection = arg.direction;
            sortOrder.push(
                (scoreDirection === null || scoreDirection === void 0) ?
                {score: null} :
                {score: null, direction: scoreDirection}
                );
            continue;
          } else if (scoreOption === void 0) {
            scoreOption = null;
          }
        }
  
        sortOrder.push(arg);
      }
    }
  
    self.orderByClause = (scoreOption === null) ? {
      'sort-order': sortOrder
    } : {
      'sort-order': sortOrder,
      scoreOption:  scoreOption
    };
  
    return self;
  }