Sets elasticsearch `size` search request param
 Default value is set in the elasticsearch and is 10.

 @example
  UsersIndex.filter{ name == 'Johny' }.limit(100)
     # => {body: {
            query: {...},
            size: 100
          }}
192115
def limit(value = nil, &block)
      chain { criteria.update_request_options size: block || Integer(value) }
    end
1329858
def SetUsername(self, username):
    
    self._username = username
    logger.debug('Elasticsearch username: {0!s}'.format(username))
137719
private void setLimit(int from, int size) {
		request.setFrom(from);

		if (size > -1) {
			request.setSize(size);
		}
	}
205716
private void parseLimitFieldSize(Map<Object, Object> props) {
        Object value = props.get(HttpConfigConstants.PROPNAME_LIMIT_FIELDSIZE);
        if (null != value) {
            try {
                this.limitFieldSize = rangeLimit(convertInteger(value), HttpConfigConstants.MIN_LIMIT_FIELDSIZE, HttpConfigConstants.MAX_LIMIT_FIELDSIZE);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: field size limit is " + getLimitOfFieldSize());
                }
            } catch (NumberFormatException nfe) {
                FFDCFilter.processException(nfe, getClass().getName() + ".parseLimitFieldSize", "1");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Invaild max field size setting of " + value);
                }
            }
        }
    }
92053
function(query, options) {
            var nresults = 0, content;

            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                caseSensitive: false
            });

            query = options.caseSensitive ? query : query.toLowerCase();

            nresults = this.filter(function(model, item) {
                content = this.options.searchAttribute != null ? model.get(this.searchAttribute, "") : item.$el.text();
                content = options.caseSensitive ? content : content.toLowerCase();
                return content.search(query) >= 0;
            }, this);

            if (!options.silent) this.trigger("search", {
                query: query,
                n: nresults
            });

            return this;
        }
1178955
def search(self):
        """"""
        search = self.document_class().search()  # pylint: disable=not-callable

        search = self.custom_filter(search)

        search = self.filter_search(search)
        search = self.order_search(search)
        search = self.filter_permissions(search)

        if search.count() > ELASTICSEARCH_SIZE:
            limit = self.paginator.get_limit(self.request)

            if not limit or limit > ELASTICSEARCH_SIZE:
                raise TooManyResults()

        search = search.extra(size=ELASTICSEARCH_SIZE)
        return search
1343013
function elasticsearchGlobal (elasticsearchClient) {
    // set client
    if (defined(elasticsearchClient)) {
        // set global client
        ImmutableCoreModel.global().defaultElasticsearchClient =  elasticsearchClient
        // return model when setting value
        return ImmutableCoreModel
    }
    else {
        return ImmutableCoreModel.global().defaultElasticsearchClient
    }
}
1285176
private static void createIndexWithSettingsInElasticsearch(RestClient client, String index, String settings) throws Exception {
		logger.trace("createIndex([{}])", index);

		assert client != null;
		assert index != null;

        Request request = new Request("PUT", "/" + index);

		// If there are settings for this index, we use it. If not, using Elasticsearch defaults.
		if (settings != null) {
			logger.trace("Found settings for index [{}]: [{}]", index, settings);
			request.setJsonEntity(settings);
		}

        Response response = client.performRequest(request);
		if (response.getStatusLine().getStatusCode() != 200) {
			logger.warn("Could not create index [{}]", index);
			throw new Exception("Could not create index ["+index+"].");
		}

		logger.trace("/createIndex([{}])", index);
	}
267744
public Integer getLimit() {
    String limitFromRequest =
        uriInfo.getQueryParameters().getFirst(LimitParameter.getDefaultLimitFieldName());

    return limitFromRequest != null ? new LimitParameter(limitFromRequest).getValue()
        : LimitParameter.getDefaultLimit();
  }
863152
public long size()
    {
    	if(size==null)
    	{
	    	ODatabaseDocument db = OrientDbWebSession.get().getDatabase();
	    	OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<ODocument>(queryManager.getCountSql());
	    	List<ODocument> ret = db.query(enhanceContextByVariables(query), prepareParams());
	    	if(ret!=null && ret.size()>0)
	    	{
	    		Number sizeNumber = ret.get(0).field("count");
	    		size = sizeNumber!=null?sizeNumber.longValue():0;
	    	}
	    	else
	    	{
	    		size = 0L;
	    	}
    	}
    	return size;
    }
988284
private void setBatchSize(Object value)
    {
        if (value instanceof Integer)
        {
            this.couchDBClient.setBatchSize((Integer) value);
        }
        else if (value instanceof String)
        {
            this.couchDBClient.setBatchSize(Integer.valueOf((String) value));
        }
    }
401215
function buildReindex (opts) {
  // eslint-disable-next-line no-unused-vars
  const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
  /**
   * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request
   *
   * @param {boolean} refresh - Should the effected indexes be refreshed?
   * @param {time} timeout - Time each individual bulk request should wait for shards that are unavailable.
   * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
   * @param {boolean} wait_for_completion - Should the request should block until the reindex is complete.
   * @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
   * @param {time} scroll - Control how long to keep the search context alive
   * @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
   * @param {object} body - The search definition using the Query DSL and the prototype for the index request.
   */

  const acceptedQuerystring = [
    'refresh',
    'timeout',
    'wait_for_active_shards',
    'wait_for_completion',
    'requests_per_second',
    'scroll',
    'slices',
    'pretty',
    'human',
    'error_trace',
    'source',
    'filter_path'
  ]

  const snakeCase = {
    waitForActiveShards: 'wait_for_active_shards',
    waitForCompletion: 'wait_for_completion',
    requestsPerSecond: 'requests_per_second',
    errorTrace: 'error_trace',
    filterPath: 'filter_path'
  }

  return function reindex (params, options, callback) {
    options = options || {}
    if (typeof options === 'function') {
      callback = options
      options = {}
    }
    if (typeof params === 'function' || params == null) {
      callback = params
      params = {}
      options = {}
    }

    // check required parameters
    if (params['body'] == null) {
      const err = new ConfigurationError('Missing required parameter: body')
      return handleError(err, callback)
    }

    // validate headers object
    if (options.headers != null && typeof options.headers !== 'object') {
      const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
      return handleError(err, callback)
    }

    var warnings = []
    var { method, body, ...querystring } = params
    querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)

    if (method == null) {
      method = 'POST'
    }

    var ignore = options.ignore
    if (typeof ignore === 'number') {
      options.ignore = [ignore]
    }

    var path = ''

    path = '/' + '_reindex'

    // build request object
    const request = {
      method,
      path,
      body: body || '',
      querystring
    }

    options.warnings = warnings.length === 0 ? null : warnings
    return makeRequest(request, options, callback)
  }
}
843685
function setSearch(uri) {
  if (typeof uri.search === 'string' || uri.query === undefined) return;

  if (typeof uri.query === 'string') {
    uri.search = '?' + uri.query;
    return;
  }

  var name, filled = false;
  uri.search = '?';

  for (name in uri.query) {
    filled = true;
    uri.search += name + '=' + uri.query[name] + '&';
  }

  uri.search = uri.search.substr(0, uri.search.length - 1);
}
803958
function sizing(property, value, style, _ref) {
  var cssPrefix = _ref.cssPrefix,
      keepUnprefixed = _ref.keepUnprefixed;

  // This might change in the future
  // Keep an eye on it
  if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {
    return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed);
  }
}
37201
def set_request_args(self, args):
        
        if self.scan_limit is not None:
            args['Limit'] = self.scan_limit
        elif self.item_limit is not None:
            args['Limit'] = max(self.item_limit, self.min_scan_limit)
        else:
            args.pop('Limit', None)
582543
function(val, req, attribute) {
    if (val) {
      req = parseFloat(req);

      var size = this.getSize();

      return size === req;
    }

    return true;
  }
997325
def _default_capacity(self, value):
        
        if value is not None:
            return value
        if self.default_return_capacity or self.rate_limiters:
            return INDEXES
        return NONE