resultOffset & resultRecordCount Parameters are causing the query to return No records found

4074
8
04-05-2018 09:52 AM
JoshVan_Kylen
New Contributor III

setDefinitionExpression is including the resultOffset and resultRecordCount parameters that are causing the service query to return No records found.  If I make the same query without these parameters it returns records.

How can I eliminate these parameters from being added to the query when I set the definition expression? 

or

How can I get the service to return records with these parameters set?

resultOffset=0

resultRecordCount=1000

No records found query 

https://gis.maricopa.gov/arcgis/rest/services/Flo2d/Flo2d_Boundaries/MapServer/1/query?f=json&where=... 

If I remove theses parameters &resultOffset=0&resultRecordCount=1000 then it returns the expected 72 records. 

https://gis.maricopa.gov/arcgis/rest/services/Flo2d/Flo2d_Boundaries/MapServer/1/query?f=json&where=... 

Also of note if I change the where statement to 1=1 it will return all the records even with the resultOffset and resultRecordCount parameters

https://gis.maricopa.gov/arcgis/rest/services/Flo2d/Flo2d_Boundaries/MapServer/1/query?f=json&where=... 

8 Replies
RodrigoFelga
New Contributor III

I think that question should be on the ArcGIS Server topic.

Folow that link to see if it helps: Error: Pagination is not supported 

0 Kudos
JoshVan_Kylen
New Contributor III

Thanks,

The service indicates that it supports advanced queries including Pagination.

So, how can I eliminate the resultOffset and resultRecordCount parameters and values from being included in the query that is generated by the setDefinitionExpression?

0 Kudos
RodrigoFelga
New Contributor III

I think that could be a bug on ArcGIS Server. It should return the records with the 2 parameters. I don't know how to remove it in the API

0 Kudos
EricO_Neal1
New Contributor III
0 Kudos
JoshVan_Kylen
New Contributor III

Changing the feature layer from MODE_SNAPSHOT to the default MODE_ONDEMAND seems to have solved the issue.  

JackFairfield
Occasional Contributor II

This is only available in the 3.x version of the API.  The newer 4.x version doesn't have this property.

0 Kudos
JackFairfield
Occasional Contributor II

I have experienced the same issue in ArcServer 10.51.

The only workaround that worked for me when using the 4.x api was to enable feature access in the manager under Capabilities

And then to reference the rest endpoint at "FeatureServer" instead of "MapServer"

For Example: 

https://domain/arcgis/rest/services/maps/test/FeatureServer

0 Kudos
simoxu
by MVP Regular Contributor
MVP Regular Contributor

I have the similar issue.

I found the problem is at the REST API level when querying a ArcGIS Server Map/Feature Service with a spatial filter.

If the resultOffset and resultRecordCount are not set, it returns all the matching records, if they are set the query returns wrong number of records. for example, if the resultRecordCount is set to 500, it only returns 36 records with exceededTransferLimit=True.

This issue should affect all the other APIs that wraps the REST API, such as Javascript API, Python API, ArcGIS Runtime SDKs...