laptop and a wrench

漏洞

When a hosted feature layer view has both a view definition/filter and a topFilter parameter applied, ArcGIS Online appears to apply the topFilter parameter first and then the view definition, causing the topFilter parameter to return records filtered out by the view definition.

ArcGIS Online
漏洞 ID 编号 BUG-000164286
已提交January 11, 2024
上次修改时间May 27, 2025
适用范围ArcGIS Online
找到的版本Oct 2023
操作系统N/A
操作系统版本N/A
状态As Designed

附加信息

This is a known behavior regarding the execution order of filters in feature services. When both viewDefinitionQuery and topFilter are applied to a feature service, the system processes the topFilter first, followed by the viewDefinitionQuery. To achieve simultaneous execution of both filtering operations, the correct approach is to structure the query using sqlExpression within the viewLayerDefinition instead of using viewDefinitionQuery directly. The recommended structure is: json{ "viewDefinitionQuery": "", "viewLayerDefinition": { "filter": { "sqlExpression": "status = 'Active'" }, "topFilter": { "orderByFields": "CreationDate DESC", "groupByFields": "Name", "topCount": 1 } } } This structure ensures that both the SQL expression filter and the top filter are processed together, providing more precise control over the returned data and preventing unexpected results that may occur when filters are applied in sequence.

解决办法

For query purposes, it is recommended to not add the topFilter parameter on the view definition. Use the queryTopFeatures method to get the correct result.

重现步骤

漏洞 ID: BUG-000164286

软件:

  • ArcGIS Online

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项