Description
When querying a feature or map service from the REST endpoint on ArcGIS Server, it is possible to use Result Record Count (resultrecordcount) to obtain a number of query results. However, when the Result Record Count parameter is specified and Return Count Only is set to True, the query count does not reflect the value set in Result Record Count.
Cause
This is a known limitation.
Solution or Workaround
There are two ways to solve this issue:
- Use a file geodatabase data or non-enterprise geodatabase data to publish the map service.
- Create and publish a new query layer from the features. Follow the steps below:
- In ArcMap, open the Make Query Layer tool. Use the enterprise SDE connection as the database source.
- Use the following expression to query the features in one of the SDE feature classes.
SELECT * FROM Roads
- Add the query layer to the map.
- Publish the query layer to ArcGIS Server.
- When querying from the REST endpoint with a resultRecordCount value, the value is reflected in the query count.