code: public SearchOptions setLimit(int limit) {
      if (limit <= 0) {
        this.limit = MAX_LIMIT;
      } else {
        this.limit = Math.min(limit, MAX_LIMIT);
      }
      return this;
    }
docs: Sets the limit on the number of results to return.