- URL:
- https://<mapservice-url>/find
- Methods:
GET
- Required Capability:
- Data
- Version Introduced:
- 9.3
Description
The find
operation is performed on a map service resource. The result of this operation is a find results resource. Each result includes its value, feature ID, field name, layer ID, layer name, geometry, geometry type, and attributes in the form of name-value pairs.
You can provide arguments to the find
operation as query parameters as defined in the parameters table below.
New at 10.8
Supports the following new parameters. These parameters are only supported by map services published from ArcGIS Pro.
clipping
—Mask out layers outside of a clip polygon.spatial
—Draw or query only features that meet the spatial filter criteria.Filter
New at 10.6.1
Supports the following new parameter:
historic
—Query from a given moment in an archive-enabled layer.Moment
New at 10.5
Enhanced with the following Boolean flags to support returning unformatted values and field names:
return
Unformatted Values return
Field Name
Supports the following new parameters:
datum
—Provide a desired datum transformation to be applied while features are projected.Transformations map
—Set values to ranges applicable to all layers with the same ranges in the map service.Range Values layer
—Set range values for specific layers.Range Values layer
—Set values to parameterized filters to specific layers.Parameter Values
New at 10.1
- Support for dynamic layers was added with the
dynamic
parameter. IfLayers dynamic
is used in aLayers find
operation request, thelayer
andDefs layers
(find
) operation parameters are ignored. Instead, usedefinition
, available withinExpression dynamic
, to specify these values in theLayers find
operation. Only those layers that are defined indynamic
are used in theLayers find
operation. - The
gdb
parameter was introduced. Use this parameter to switch the geodatabase version of the map layer's data source.Version - The
geometry
parameter was introduced. This option can be used to specify the number of decimal places in the response geometries returned by thePrecision identify
operation. - JSON response contains an optional property,
exceeded
. This property will beTransfer Limit true
only if the number of records exceeds the maximum number configured by the server administrator.
New at 10.0
Support for generalizing
geometries returned by the find
operation was added.
Request parameters
Parameter | Details |
---|---|
(Required) | The search string. This is the text that is searched across the layers and fields the user specifies. Example
|
| If Values: |
| The names of the fields to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched. Syntax
Example
|
| The well-known ID of the spatial reference of the output geometries. If |
| Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers. A definition expression for a layer that is published with the service will be always honored. Syntax
Example
|
(Required) | The layers on which to perform the Syntax
Example
|
| If Values: |
| This option can be used to specify the Example
|
| This option can be used to specify the number of decimal places in the response geometries returned by the Example
|
| Use the Syntax
Example
|
| If |
| If |
| Switch map layers to point to an alternate geodatabase version. Syntax
Example
|
| This option was added at 10.5. If Values: |
| This option was added at 10.5. If Values: |
| This option was added at 10.5. Use this parameter to apply one or more datum transformations to the map when For a list of valid datum transformation ID values and well-known text strings, see Using spatial references. For more information on datum transformation, see the Syntax
Examples
|
| This option was added at 10.5. It allows you to filter features in the exported map from all layers that are within the specified range instant or extent. Syntax
Example
|
| This option was added at 10.5. It allows you to filter features for each individual layer that are within the specified range instant or extent. Syntax
Example
|
| This option was added at 10.5. It allows you to filter the features of individual layers by specifying a value or values to an array of preauthored parameterized filters for those layers. When a value is not specified for any parameter in a request, the default value, which is assigned during authoring time, gets used instead. When a Syntax
Example
|
| This option was added at 10.6.1. This is the historic moment to find. This parameter applies only if the layer is archiving enabled and the Syntax
Example
|
| This parameter was added at 10.8. It allows you to mask out layers outside of the clip polygon in the exported map. Clipping can mask out any layer type, for example, feature layers, raster layers, and TIN layers. Optionally, you can use Syntax
Example
|
| This parameter was added at 10.8. It allows you to filter out features from all features layers based on the input spatial filter. It is similar to Syntax
Example
|
| The response format. The default response format is Values: |
Example usage
Example 1: The Find
operation that includes search text and a layer. The response is in HTML format:
https://machine.domain.com/arcgis/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/find?searchText=island&contains=true&searchFields=&sr=&layers=0,2&returnGeometry=true
Example 2: The Find
operation with dynamic
:
https://machine.domain.com/arcgis/rest/services/Census/MapServer/find?searchText=Calif&contains=true&searchFields=&sr=&layers=&layerDefs=&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&dynamicLayers=[{"id":501,"source":{"type":"mapLayer","mapLayerId":3}}]&returnZ=false&returnM=false&gdbVersion=&f=html
JSON Response syntax
{
"results": [
{
"layerId": <layerId1>,
"layerName": "<layerName1>",
"displayFieldName": "<displayFieldName1>",
"foundFieldName": "<foundFieldName1>",
"value": "<value1>",
"attributes": {
"<fieldName11>": <fieldValue11>,
"<fieldName12>": <fieldValue12>
},
"geometryType": "<geometryType1>",
"hasZ": <true|false>, //added in 10.1
"hasM": <true|false>, //added in 10.1
"geometry": {<geometry1>}
},
{
"layerId": <layerId2>,
"layerName": "<layerName2>",
"displayFieldName": "<displayFieldName2>",
"foundFieldName": "<foundFieldName2>",
"value": "<value2>",
"attributes": {
"<fieldName21>": <fieldValue21>,
"<fieldName22>": <fieldValue22>
},
"geometryType": "<geometryType2>",
"hasZ": <true|false>, //added in 10.1
"hasM": <true|false>, //added in 10.1
"geometry": {<geometry2>}
}
]
}
JSON Response example
{
"results": [
{
"layerId": 3,
"layerName": "Cities",
"displayFieldName": "City Name",
"foundFieldName": "City Name",
"value": "Joe City",
"attributes": {
"City Name": "Joe City",
"CLASS": "city",
"ST": "CA"
},
"geometryType": "esriGeometryPoint",
"geometry": {
"x": -118.375,
"y": 34.086,
"spatialReference": {
"wkid": 4326
}
}
},
{
"layerId": 59,
"layerName": "Parcel",
"displayFieldName": "NAME",
"foundFieldName": "NAME",
"value": "Joe's Parcel",
"attributes": {
"NAME": "Parcel 649",
"SUB_REGION": "Pacific",
"STATE_ABBR": "CA"
},
"geometryType": "esriGeometryPolygon",
"geometry": {
"spatialReference": {
"wkid": 4326
},
"rings": [
[
[-118.35,32.81],
[-118.42.806],
[-118.511,32.892],
[-118.35,32.81]
]
]
}
}
]
}