queryTask.executeForCount(query,function(count){ alert(count + " features matched the input query"); },function(error){ console.log(error); });
queryTask.execute(query,showResults); function showResults(results) { alert(results.features.length); }
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...