Select to view content in your preferred language

How to reduced query result limit..?

3707
17
08-06-2018 10:02 AM
Rocky_
by
Frequent Contributor

I am trying to query feature from service url. which having set  MaxRecordCount: 100000 ..

is there any possible way to reduced the limit for query results, cause this MaxRecordCount: 100000 giving me error of Timeout exceeded and Error performing query operation. 

Can anyone please tell me how to solve this issue.

Thanks in advance..

0 Kudos
17 Replies
JohnGrayson
Esri Regular Contributor

You can try using the 'start' and 'num' parameters to break up the queries into manageable numbers (Query | API Reference | ArcGIS API for JavaScript 4.8)   Providing a decent UX for >100,000 features can be tricky so might think about filtering the data as part or your query, or providing a some type of 'paging' UI.

Rocky_
by
Frequent Contributor

Hello john,

   Can you please share me a snippet or sample for it..

0 Kudos
JohnGrayson
Esri Regular Contributor

Hello Raj,

   can you please provide a simplified version of the specific portion of your code as a working codepen, jsbin, or similar, so we can see what you're trying?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

RAJ,

  You can set the esriConfig request timeout property.

https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request 

Rocky_
by
Frequent Contributor

Hi Robert,

    can you please share a snippet, how to use this timeout property..?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
require(["esri/config"], function(esriConfig) {
  esriConfig.request.timeout = 120000;
});

This will affect all queries made in that app.

Rocky_
by
Frequent Contributor

Tried this one, but not working.. still got same error timeout exceeded...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

RAJ,

   Then it could be that 2 minutes is still not long enough and you are getting into the seriously unacceptable user wait time.

Rocky_
by
Frequent Contributor

so what is the possible solution for this..? can we reduced the result count to certain limit.. such as

max 5000 count per query

0 Kudos