code: function (ctx, next) {
      var filter;
      if (ctx.args && ctx.args.filter) {
        filter = ctx.args.filter.where;
      }
  
      if (!ctx.res._headerSent) {
        this.count(filter, function (err, count) {
          ctx.res.set('X-Total-Count', count);
          next();
        });
      } else {
        next();
      }
    }
docs: Set X-Total-Count for all search requests