queryTask & max records returned?

1267
3
03-16-2011 12:39 PM
DerekLoi
New Contributor III
does anyone know if the queryTask class only returns a set max number of records of 1000?
i have checked the where clause and the feature's data and it all looks fine.  I tried a different where clause to pull only a couple hundred rows and that worked fine.  It just seems to only return max of 1000 records when i'm trying to query for 1500+ records.
0 Kudos
3 Replies
DerekLoi
New Contributor III
i tried this code and it returned the correct record count which is 1572
queryTask.executeForCount(query,function(count){
 alert(count + " features matched the input query");
},function(error){
 console.log(error);
});


but after running the following code:
queryTask.execute(query,showResults);

function showResults(results) {
 alert(results.features.length);
}

... the results.features.length is alway 1000 ... should be 1572
am I missing something here?
0 Kudos
RobWaller
New Contributor III
This may be related to the Maximum Record Count setting on the service. Is this your own service you have access to? If so, you can change it in the service configuration file, should be in the server folder in program directory, i.e in server 9:
C:\Program Files\ArcGIS\server\user\cfg\myService.cfg
Look for this tag in the .cfg file and update it, then save and restart the ArcGIS Server Object Manager service
<MaxRecordCount>1000</MaxRecordCount>
If you're using AGS Server 10, the above file will be in the 'Server10.0' directory, vs 'server' folder. Also, in Server 10 this option is now available via service properties in ArcCatalog, go to the properties of the service, then the 'Parameters' tab, then set 'Maximum Number of records returned by Server' to whatever you need and restart.

I think the default is 500, if yours is not showing 1000 here then maybe some other issue.


More info on service config files:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/0093/0093000000mr000000.h...
0 Kudos
DerekLoi
New Contributor III
This may be related to the Maximum Record Count setting on the service. Is this your own service you have access to? If so, you can change it in the service configuration file, should be in the server folder in program directory, i.e in server 9:
C:\Program Files\ArcGIS\server\user\cfg\myService.cfg
Look for this tag in the .cfg file and update it, then save and restart the ArcGIS Server Object Manager service
<MaxRecordCount>1000</MaxRecordCount>
If you're using AGS Server 10, the above file will be in the 'Server10.0' directory, vs 'server' folder. Also, in Server 10 this option is now available via service properties in ArcCatalog, go to the properties of the service, then the 'Parameters' tab, then set 'Maximum Number of records returned by Server' to whatever you need and restart.

I think the default is 500, if yours is not showing 1000 here then maybe some other issue.


More info on service config files:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/0093/0093000000mr000000.h...


Thank you for the help!!! That worked!
0 Kudos